Skip to content

Commit

Permalink
Merge pull request #10 from getappmap/fix/handle-exit-via-signal
Browse files Browse the repository at this point in the history
fix: Handle exit via signal
  • Loading branch information
kgilpin authored Apr 14, 2023
2 parents 9860cfa + a90533d commit e55a192
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/appmap-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
run: yarn install
- name: Install and configure AppMap
uses: getappmap/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
verbose: true
- name: Build AppMaps
run: yarn appmap
- name: Archive AppMaps
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ jobs:
run: yarn install
- name: Install and configure AppMap
uses: getappmap/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
verbose: true
- name: Commit AppMap configuration changes
uses: EndBug/add-and-commit@v7
with:
add: .
message: 'chore: Update AppMap installation'
- name: Build
run: yarn build
- name: Make AppMaps
Expand Down
6 changes: 4 additions & 2 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.

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

0 comments on commit e55a192

Please sign in to comment.