Skip to content

Instantly share code, notes, and snippets.

@tamzinblake
Created September 7, 2013 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamzinblake/6471732 to your computer and use it in GitHub Desktop.
Save tamzinblake/6471732 to your computer and use it in GitHub Desktop.
$ git diff master
diff --git a/lib/ls.js b/lib/ls.js
index 842b612..194aae6 100644
--- a/lib/ls.js
+++ b/lib/ls.js
@@ -63,6 +63,8 @@ function ls (args, silent, cb) {
}
console.log(out)
+ if (args.length && !data._found) process.exitCode = 1
+
// if any errors were found, then complain and exit status 1
if (lite.problems && lite.problems.length) {
er = lite.problems.join('\n')
diff --git a/lib/utils/error-handler.js b/lib/utils/error-handler.js
index 8637592..a82f97e 100644
--- a/lib/utils/error-handler.js
+++ b/lib/utils/error-handler.js
@@ -44,7 +44,7 @@ process.on("exit", function (code) {
})
function exit (code, noLog) {
- exitCode = exitCode || code
+ exitCode = exitCode || process.exitCode || code
var doExit = npm.config.get("_exit")
log.verbose("exit", [code, doExit])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment