add check for stderr

This commit is contained in:
Dmitry Shibanov 2021-12-13 11:31:57 +03:00
parent fe0d1625a2
commit 71715969b1
3 changed files with 23590 additions and 32173 deletions

27929
dist/cache-save/index.js vendored

File diff suppressed because it is too large Load diff

27823
dist/setup/index.js vendored

File diff suppressed because it is too large Load diff

View file

@ -30,9 +30,16 @@ export const supportedPackageManagers: SupportedPackageManagers = {
}; };
export const getCommandOutput = async (toolCommand: string) => { export const getCommandOutput = async (toolCommand: string) => {
const {stdout, stderr, exitCode} = await exec.getExecOutput(toolCommand); let {stdout, stderr, exitCode} = await exec.getExecOutput(
toolCommand,
undefined,
{ignoreReturnCode: true}
);
if (exitCode && stderr) { if (exitCode) {
stderr = !stderr
? `The '${toolCommand}' command failed with exit code: ${exitCode}`
: stderr;
throw new Error(stderr); throw new Error(stderr);
} }