Skip to content

Commit

Permalink
Merge pull request #11 from getappmap/feat/log-kill-warning
Browse files Browse the repository at this point in the history
feat: Log command string when killed by a signal
  • Loading branch information
kgilpin authored May 15, 2023
2 parents b249571 + 87f7442 commit 46c4eff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
7 changes: 3 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class Compare {

log(
LogLevel.Info,
`Comparing base revision ${this.baseRevision} to head revision ${this.headRevision}`
`Comparing base revision ${this.baseRevision} with head revision ${this.headRevision}`
);
log(LogLevel.Debug, `Report output directory is ${outputDir}`);

Expand Down
8 changes: 6 additions & 2 deletions src/executeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ export function executeCommand(
return new Promise<string>((resolve, reject) => {
command.addListener('exit', (code, signal) => {
if (signal || code === 0) {
if (signal) log(LogLevel.Info, `Command killed by signal ${signal}`);
if (signal)
log(
LogLevel.Warn,
`Command "${commandString}" killed by signal ${signal}, exited with code ${code}`
);
resolve(result.join(''));
} else {
if (!printCommand) log(LogLevel.Warn, commandString);
log(LogLevel.Warn, `Command "${commandString}" exited with failure code ${code}`);
log(LogLevel.Warn, stderr.join(''));
log(LogLevel.Warn, result.join(''));

Expand Down

0 comments on commit 46c4eff

Please sign in to comment.