Skip to content

Commit 67ab0e8

Browse files
committed
Trim command, add failOnStdErr and silent params
1 parent af774eb commit 67ab0e8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

helpers/action/exec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ import { exec as coreExec } from "@actions/exec";
66
* This action fails if data is outputted to stderr
77
* @param commandLine The command to run
88
*/
9-
export const exec = async (commandLine: string) => {
9+
export const exec = async (commandLine: string, failOnStdErr: boolean = true, silent: boolean = true) => {
1010
let stdoutData = "";
11-
await coreExec(commandLine, undefined, {
11+
await coreExec(commandLine.trim(), undefined, {
1212
listeners: {
1313
stdout: (data: Buffer) => {
1414
stdoutData += data.toString();
1515
},
1616
},
17-
failOnStdErr: true
17+
failOnStdErr,
18+
silent
1819
});
1920
return stdoutData;
20-
};
21+
};

0 commit comments

Comments
 (0)