Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-03-24 01:16:49 +0300
committerLuke Karrys <luke@lukekarrys.com>2022-03-28 23:21:36 +0300
commit45dd8b8615bb1d7a93e1733746581049a1f399e6 (patch)
tree0e8a1df227b0258714f0637d82720374f5bf4fb3 /lib/utils
parent99d88454248f950b82652b592fe2b4d019c1060b (diff)
fix: move shellout logic into commands
Each command now signals whether or not it is a shellout
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/cmd-list.js14
-rw-r--r--lib/utils/exit-handler.js2
2 files changed, 1 insertions, 15 deletions
diff --git a/lib/utils/cmd-list.js b/lib/utils/cmd-list.js
index b3089a62c..1469ebdd6 100644
--- a/lib/utils/cmd-list.js
+++ b/lib/utils/cmd-list.js
@@ -139,24 +139,10 @@ const cmdList = [
const plumbing = ['birthday', 'help-search']
-// these commands just shell out to something else or handle the
-// error themselves, so it's confusing and weird to write out
-// our full error log banner when they exit non-zero
-const shellouts = [
- 'exec',
- 'run-script',
- 'test',
- 'start',
- 'stop',
- 'restart',
- 'birthday',
-]
-
module.exports = {
aliases: Object.assign({}, shorthands, affordances),
shorthands,
affordances,
cmdList,
plumbing,
- shellouts,
}
diff --git a/lib/utils/exit-handler.js b/lib/utils/exit-handler.js
index f96d162ce..d8ae9994d 100644
--- a/lib/utils/exit-handler.js
+++ b/lib/utils/exit-handler.js
@@ -144,7 +144,7 @@ const exitHandler = err => {
// will presumably print its own errors and exit with a proper status
// code if there's a problem. If we got an error with a code=0, then...
// something else went wrong along the way, so maybe an npm problem?
- const isShellout = npm.shelloutCommands.includes(npm.command)
+ const isShellout = npm.commandInstance && npm.commandInstance.constructor.isShellout
const quietShellout = isShellout && typeof err.code === 'number' && err.code
if (quietShellout) {
exitCode = err.code