From ce4724a3835ded9a4a29d8d67323f925461155e5 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Mon, 19 Oct 2020 08:07:29 +1300 Subject: fix: check `result` when determining exit code of `ls ` PR-URL: https://github.com/npm/cli/pull/1986 Credit: @G-Rath Close: #1986 Reviewed-by: @ruyadorno --- lib/ls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ls.js') 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 } -- cgit v1.2.3