Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
try exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Jul 18, 2024
1 parent e766ff7 commit 45d6fea
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ inputs:
description: "2FA (Authenticator App) key"
required: false
default: ''
deprecationMessage: 'This input is no longer required and is unused'

runs:
using: 'node20'
Expand Down
13 changes: 7 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26338,24 +26338,25 @@ const client = getLicensingClient();

async function execWithMask(command) {
let output = '';
let error = '';
let exitCode = 0;
try {
await exec.exec(command, [], {
exitCode = await exec.exec(command, [], {
silent: true,
listeners: {
stdout: (data) => {
output += data.toString();
},
stderr: (data) => {
error += data.toString();
output += data.toString();
}
}
});

} finally {
core.info(maskSerialInOutput(output));
if (error !== '') {
throw Error(error);
if (exitCode !== 0) {
throw Error(`${output}`);
} else {
core.info(maskSerialInOutput(output));
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions src/licensing-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,25 @@ const client = getLicensingClient();

async function execWithMask(command) {
let output = '';
let error = '';
let exitCode = 0;
try {
await exec.exec(command, [], {
exitCode = await exec.exec(command, [], {
silent: true,
listeners: {
stdout: (data) => {
output += data.toString();
},
stderr: (data) => {
error += data.toString();
output += data.toString();
}
}
});

} finally {
core.info(maskSerialInOutput(output));
if (error !== '') {
throw Error(error);
if (exitCode !== 0) {
throw Error(`${output}`);
} else {
core.info(maskSerialInOutput(output));
}
}
};
Expand Down

0 comments on commit 45d6fea

Please sign in to comment.