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/ls.js
diff options
context:
space:
mode:
authorGareth Jones <jones258@gmail.com>2020-10-18 22:07:29 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2020-10-20 21:21:23 +0300
commitce4724a3835ded9a4a29d8d67323f925461155e5 (patch)
treec40268ff113b62ef1e30851f5c25f7debb8d0010 /lib/ls.js
parent89fbf733f95b3c7633877a97eb02be243ee92c6f (diff)
fix: check `result` when determining exit code of `ls <filter>`
PR-URL: https://github.com/npm/cli/pull/1986 Credit: @G-Rath Close: #1986 Reviewed-by: @ruyadorno
Diffstat (limited to 'lib/ls.js')
-rw-r--r--lib/ls.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ls.js b/lib/ls.js
index d55cdfb45..2dd6e4d4e 100644
--- a/lib/ls.js
+++ b/lib/ls.js
@@ -488,7 +488,7 @@ const ls = async (args) => {
)
// if filtering items, should exit with error code on no results
- if (!tree[_include] && args.length) {
+ if (result && !result[_include] && args.length) {
process.exitCode = 1
}