azure-pipelines-task-lib 4.15.0 → 4.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/internal.js CHANGED
@@ -174,7 +174,6 @@ function _setResourcePath(path, ignoreWarnings) {
174
174
  }
175
175
  else {
176
176
  if (ignoreWarnings) {
177
- _debug(_loc('LIB_ResourceFileAlreadySet', path));
178
177
  }
179
178
  else {
180
179
  _warning(_loc('LIB_ResourceFileAlreadySet', path), IssueSource.TaskInternal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-pipelines-task-lib",
3
- "version": "4.15.0",
3
+ "version": "4.17.0",
4
4
  "description": "Azure Pipelines Task SDK",
5
5
  "main": "./task.js",
6
6
  "typings": "./task.d.ts",
@@ -31,7 +31,7 @@
31
31
  "minimatch": "3.0.5",
32
32
  "nodejs-file-downloader": "^4.11.1",
33
33
  "q": "^1.5.1",
34
- "semver": "^5.1.0",
34
+ "semver": "^5.7.2",
35
35
  "shelljs": "^0.8.5",
36
36
  "uuid": "^3.0.1"
37
37
  },
package/toolrunner.d.ts CHANGED
@@ -167,5 +167,5 @@ export declare class ToolRunner extends events.EventEmitter {
167
167
  * Used to close child process by sending SIGNINT signal.
168
168
  * It allows executed script to have some additional logic on SIGINT, before exiting.
169
169
  */
170
- killChildProcess(): void;
170
+ killChildProcess(signal?: number | NodeJS.Signals): void;
171
171
  }
package/toolrunner.js CHANGED
@@ -578,12 +578,14 @@ var ToolRunner = /** @class */ (function (_super) {
578
578
  }
579
579
  //pipe stdout of first tool to stdin of second tool
580
580
  (_a = cpFirst.stdout) === null || _a === void 0 ? void 0 : _a.on('data', function (data) {
581
- var _a;
581
+ var _a, _b;
582
582
  try {
583
583
  if (fileStream) {
584
584
  fileStream.write(data);
585
585
  }
586
- (_a = cp.stdin) === null || _a === void 0 ? void 0 : _a.write(data);
586
+ if (!((_a = cp.stdin) === null || _a === void 0 ? void 0 : _a.destroyed)) {
587
+ (_b = cp.stdin) === null || _b === void 0 ? void 0 : _b.write(data);
588
+ }
587
589
  }
588
590
  catch (err) {
589
591
  _this._debug('Failed to pipe output of ' + toolPathFirst + ' to ' + toolPath);
@@ -1038,14 +1040,14 @@ var ToolRunner = /** @class */ (function (_super) {
1038
1040
  cp.on('exit', function (code, signal) {
1039
1041
  state.processExitCode = code;
1040
1042
  state.processExited = true;
1041
- _this._debug("Exit code " + code + " received from tool '" + _this.toolPath + "'");
1043
+ _this._debug("STDIO streams have closed and received exit code " + code + " and signal " + signal + " for tool '" + _this.toolPath + "'");
1042
1044
  state.CheckComplete();
1043
1045
  });
1044
1046
  cp.on('close', function (code, signal) {
1045
1047
  state.processExitCode = code;
1046
1048
  state.processExited = true;
1047
1049
  state.processClosed = true;
1048
- _this._debug("STDIO streams have closed for tool '" + _this.toolPath + "'");
1050
+ _this._debug("STDIO streams have closed and received exit code " + code + " and signal " + signal + " for tool '" + _this.toolPath + "'");
1049
1051
  state.CheckComplete();
1050
1052
  });
1051
1053
  return new Promise(emitDoneEvent);
@@ -1149,14 +1151,14 @@ var ToolRunner = /** @class */ (function (_super) {
1149
1151
  cp.on('exit', function (code, signal) {
1150
1152
  state.processExitCode = code;
1151
1153
  state.processExited = true;
1152
- _this._debug("Exit code " + code + " received from tool '" + _this.toolPath + "'");
1154
+ _this._debug("STDIO streams have closed and received exit code " + code + " and signal " + signal + " for tool '" + _this.toolPath + "'");
1153
1155
  state.CheckComplete();
1154
1156
  });
1155
1157
  cp.on('close', function (code, signal) {
1156
1158
  state.processExitCode = code;
1157
1159
  state.processExited = true;
1158
1160
  state.processClosed = true;
1159
- _this._debug("STDIO streams have closed for tool '" + _this.toolPath + "'");
1161
+ _this._debug("STDIO streams have closed and received exit code " + code + " and signal " + signal + " for tool '" + _this.toolPath + "'");
1160
1162
  state.CheckComplete();
1161
1163
  });
1162
1164
  return defer.promise;
@@ -1199,9 +1201,11 @@ var ToolRunner = /** @class */ (function (_super) {
1199
1201
  * Used to close child process by sending SIGNINT signal.
1200
1202
  * It allows executed script to have some additional logic on SIGINT, before exiting.
1201
1203
  */
1202
- ToolRunner.prototype.killChildProcess = function () {
1204
+ ToolRunner.prototype.killChildProcess = function (signal) {
1205
+ if (signal === void 0) { signal = "SIGTERM"; }
1203
1206
  if (this.childProcess) {
1204
- this.childProcess.kill();
1207
+ this._debug("[killChildProcess] Signal " + signal + " received");
1208
+ this.childProcess.kill(signal);
1205
1209
  }
1206
1210
  };
1207
1211
  return ToolRunner;