mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-19 12:54:45 +00:00
Throw error only if exit code is note zero. (#358)
This commit is contained in:
parent
04c56d2f95
commit
9a74eb4e64
4 changed files with 20 additions and 7 deletions
7
dist/cache-save/index.js
vendored
7
dist/cache-save/index.js
vendored
|
@ -3836,8 +3836,11 @@ exports.supportedPackageManagers = {
|
|||
}
|
||||
};
|
||||
exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand);
|
||||
if (stderr) {
|
||||
let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, { ignoreReturnCode: true });
|
||||
if (exitCode) {
|
||||
stderr = !stderr.trim()
|
||||
? `The '${toolCommand}' command failed with exit code: ${exitCode}`
|
||||
: stderr;
|
||||
throw new Error(stderr);
|
||||
}
|
||||
return stdout.trim();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue