mirror of
https://github.com/actions/setup-node.git
synced 2025-04-24 12:22:12 +00:00
add check for stderr
This commit is contained in:
parent
fe0d1625a2
commit
71715969b1
3 changed files with 23590 additions and 32173 deletions
23503
dist/cache-save/index.js
vendored
23503
dist/cache-save/index.js
vendored
File diff suppressed because it is too large
Load diff
23411
dist/setup/index.js
vendored
23411
dist/setup/index.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue