Skip to content

Commit

Permalink
fix: strip ansi from stdout and stderr (#158)
Browse files Browse the repository at this point in the history
@W-9621790@
  • Loading branch information
peternhale committed Jul 23, 2021
1 parent a384aff commit 960b201
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/execCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ const execCmdSync = <T extends ExecCmdResult, U = Collection>(cmd: string, optio
// Execute the command in a synchronous child process
const startTime = process.hrtime();
result.shellOutput = shelljs.exec(cmd, cmdOptions) as ShellString;
result.shellOutput.stdout = stripAnsi(result.shellOutput.stdout);
result.shellOutput.stderr = stripAnsi(result.shellOutput.stderr);
result.execCmdDuration = hrtimeToMillisDuration(process.hrtime(startTime));
debug(`Command completed with exit code: ${result.shellOutput.code}`);

Expand Down

0 comments on commit 960b201

Please sign in to comment.