Skip to content

Commit

Permalink
Skip Nodemon (SIGINT) exit or aborted task errors
Browse files Browse the repository at this point in the history
The previous commit lets Gulp hande `new PluginError()` versus logging to console, so we now need to skip typical “watch + restart” errors seen during development
  • Loading branch information
colinrotherham committed Sep 20, 2023
1 parent a2a313f commit 41fd5b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shared/tasks/npm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export async function run(name, args = [], options) {
throw new Error(`Task '${name}' not found in '${pkgPath}'`)
}
} catch (cause) {
// Skip Nodemon (SIGINT) exit or aborted task errors
// https://tldp.org/LDP/abs/html/exitcodes.html
if (cause.signal === 'SIGINT' || cause.code === 130) {
return
}

throw new PluginError(`npm run ${name}`, cause, {
// Hide error properties already formatted by npm
showProperties: false
Expand Down

0 comments on commit 41fd5b7

Please sign in to comment.