Update generated content

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-06-23 14:26:04 +02:00
parent 90e26af07a
commit 9db0a23fb3
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

135
dist/index.js generated vendored
View File

@ -731,6 +731,25 @@ module.exports = compareBuild
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@ -740,20 +759,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.argStringToArray = exports.ToolRunner = void 0;
const os = __importStar(__webpack_require__(87)); const os = __importStar(__webpack_require__(87));
const events = __importStar(__webpack_require__(614)); const events = __importStar(__webpack_require__(614));
const child = __importStar(__webpack_require__(129)); const child = __importStar(__webpack_require__(129));
const path = __importStar(__webpack_require__(622)); const path = __importStar(__webpack_require__(622));
const io = __importStar(__webpack_require__(436)); const io = __importStar(__webpack_require__(436));
const ioUtil = __importStar(__webpack_require__(962)); const ioUtil = __importStar(__webpack_require__(962));
const timers_1 = __webpack_require__(213);
/* eslint-disable @typescript-eslint/unbound-method */ /* eslint-disable @typescript-eslint/unbound-method */
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
/* /*
@ -823,11 +837,12 @@ class ToolRunner extends events.EventEmitter {
s = s.substring(n + os.EOL.length); s = s.substring(n + os.EOL.length);
n = s.indexOf(os.EOL); n = s.indexOf(os.EOL);
} }
strBuffer = s; return s;
} }
catch (err) { catch (err) {
// streaming lines to console is best effort. Don't fail a build. // streaming lines to console is best effort. Don't fail a build.
this._debug(`error processing line. Failed with error ${err}`); this._debug(`error processing line. Failed with error ${err}`);
return '';
} }
} }
_getSpawnFileName() { _getSpawnFileName() {
@ -1109,7 +1124,7 @@ class ToolRunner extends events.EventEmitter {
// if the tool is only a file name, then resolve it from the PATH // if the tool is only a file name, then resolve it from the PATH
// otherwise verify it exists (add extension on Windows if necessary) // otherwise verify it exists (add extension on Windows if necessary)
this.toolPath = yield io.which(this.toolPath, true); this.toolPath = yield io.which(this.toolPath, true);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
this._debug(`exec tool: ${this.toolPath}`); this._debug(`exec tool: ${this.toolPath}`);
this._debug('arguments:'); this._debug('arguments:');
for (const arg of this.args) { for (const arg of this.args) {
@ -1123,9 +1138,12 @@ class ToolRunner extends events.EventEmitter {
state.on('debug', (message) => { state.on('debug', (message) => {
this._debug(message); this._debug(message);
}); });
if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
}
const fileName = this._getSpawnFileName(); const fileName = this._getSpawnFileName();
const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
const stdbuffer = ''; let stdbuffer = '';
if (cp.stdout) { if (cp.stdout) {
cp.stdout.on('data', (data) => { cp.stdout.on('data', (data) => {
if (this.options.listeners && this.options.listeners.stdout) { if (this.options.listeners && this.options.listeners.stdout) {
@ -1134,14 +1152,14 @@ class ToolRunner extends events.EventEmitter {
if (!optionsNonNull.silent && optionsNonNull.outStream) { if (!optionsNonNull.silent && optionsNonNull.outStream) {
optionsNonNull.outStream.write(data); optionsNonNull.outStream.write(data);
} }
this._processLineBuffer(data, stdbuffer, (line) => { stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
if (this.options.listeners && this.options.listeners.stdline) { if (this.options.listeners && this.options.listeners.stdline) {
this.options.listeners.stdline(line); this.options.listeners.stdline(line);
} }
}); });
}); });
} }
const errbuffer = ''; let errbuffer = '';
if (cp.stderr) { if (cp.stderr) {
cp.stderr.on('data', (data) => { cp.stderr.on('data', (data) => {
state.processStderr = true; state.processStderr = true;
@ -1156,7 +1174,7 @@ class ToolRunner extends events.EventEmitter {
: optionsNonNull.outStream; : optionsNonNull.outStream;
s.write(data); s.write(data);
} }
this._processLineBuffer(data, errbuffer, (line) => { errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
if (this.options.listeners && this.options.listeners.errline) { if (this.options.listeners && this.options.listeners.errline) {
this.options.listeners.errline(line); this.options.listeners.errline(line);
} }
@ -1203,7 +1221,7 @@ class ToolRunner extends events.EventEmitter {
} }
cp.stdin.end(this.options.input); cp.stdin.end(this.options.input);
} }
}); }));
}); });
} }
} }
@ -1289,7 +1307,7 @@ class ExecState extends events.EventEmitter {
this._setResult(); this._setResult();
} }
else if (this.processExited) { else if (this.processExited) {
this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
} }
} }
_debug(message) { _debug(message) {
@ -1718,6 +1736,13 @@ module.exports = require("https");
/***/ }), /***/ }),
/***/ 213:
/***/ (function(module) {
module.exports = require("timers");
/***/ }),
/***/ 219: /***/ 219:
/***/ (function(__unusedmodule, exports, __webpack_require__) { /***/ (function(__unusedmodule, exports, __webpack_require__) {
@ -2439,6 +2464,13 @@ const diff = (version1, version2) => {
module.exports = diff module.exports = diff
/***/ }),
/***/ 304:
/***/ (function(module) {
module.exports = require("string_decoder");
/***/ }), /***/ }),
/***/ 309: /***/ 309:
@ -3438,6 +3470,25 @@ exports._readLinuxVersionFile = _readLinuxVersionFile;
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@ -3447,14 +3498,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getExecOutput = exports.exec = void 0;
const string_decoder_1 = __webpack_require__(304);
const tr = __importStar(__webpack_require__(159)); const tr = __importStar(__webpack_require__(159));
/** /**
* Exec a command. * Exec a command.
@ -3480,6 +3526,51 @@ function exec(commandLine, args, options) {
}); });
} }
exports.exec = exec; exports.exec = exec;
/**
* Exec a command and get the output.
* Output will be streamed to the live console.
* Returns promise with the exit code and collected stdout and stderr
*
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
* @param args optional arguments for tool. Escaping is handled by the lib.
* @param options optional exec options. See ExecOptions
* @returns Promise<ExecOutput> exit code, stdout, and stderr
*/
function getExecOutput(commandLine, args, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
let stdout = '';
let stderr = '';
//Using string decoder covers the case where a mult-byte character is split
const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
const stdErrListener = (data) => {
stderr += stderrDecoder.write(data);
if (originalStdErrListener) {
originalStdErrListener(data);
}
};
const stdOutListener = (data) => {
stdout += stdoutDecoder.write(data);
if (originalStdoutListener) {
originalStdoutListener(data);
}
};
const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
//flush any remaining characters
stdout += stdoutDecoder.end();
stderr += stderrDecoder.end();
return {
exitCode,
stdout,
stderr
};
});
}
exports.getExecOutput = getExecOutput;
//# sourceMappingURL=exec.js.map //# sourceMappingURL=exec.js.map
/***/ }), /***/ }),