add check of exit code

This commit is contained in:
Dmitry Shibanov 2021-11-08 13:27:51 +03:00
parent 360ab8b75b
commit fe0d1625a2
3 changed files with 3 additions and 3 deletions

View file

@ -4339,7 +4339,7 @@ exports.supportedPackageManagers = {
}; };
exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () { exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () {
const { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand); const { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand);
if (stderr) { if (exitCode && stderr) {
throw new Error(stderr); throw new Error(stderr);
} }
return stdout.trim(); return stdout.trim();

2
dist/setup/index.js vendored
View file

@ -51887,7 +51887,7 @@ exports.supportedPackageManagers = {
}; };
exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () { exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () {
const { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand); const { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand);
if (stderr) { if (exitCode && stderr) {
throw new Error(stderr); throw new Error(stderr);
} }
return stdout.trim(); return stdout.trim();

View file

@ -32,7 +32,7 @@ export const supportedPackageManagers: SupportedPackageManagers = {
export const getCommandOutput = async (toolCommand: string) => { export const getCommandOutput = async (toolCommand: string) => {
const {stdout, stderr, exitCode} = await exec.getExecOutput(toolCommand); const {stdout, stderr, exitCode} = await exec.getExecOutput(toolCommand);
if (stderr) { if (exitCode && stderr) {
throw new Error(stderr); throw new Error(stderr);
} }