Comparing version 9.0.0 to 10.0.0
@@ -36,4 +36,2 @@ /*jshint laxcomma:true, smarttabs: true, unused: true, esnext: true, node: true */ | ||
process.on('unhandledRejection', onError); | ||
function onError (err) { | ||
@@ -46,7 +44,13 @@ console.error(`${chalk.red(err.name)}: ${err.message}`); | ||
} | ||
return conf.get('exitOnError') ? process.exit( err.code || 1 ) : null; | ||
const code = isFinite(err.code) ? err.code : 1 | ||
if (conf.get('exitOnError')) { | ||
process.exit(code) | ||
return | ||
} | ||
process.exitCode = code | ||
} | ||
function onComplete(content) { | ||
typeof content === 'string' && console.log( content ); | ||
typeof content === 'string' && console.log(content); | ||
if(conf.get('exitOnContent')) { | ||
@@ -154,3 +158,2 @@ process.exit(0); | ||
console.error('know commands: %s ', Object.keys( commands ).join(', ') ); | ||
process.exit(0); | ||
} |
{ | ||
"name": "seeli", | ||
"version": "9.0.0", | ||
"version": "10.0.0", | ||
"description": "Object oriented, flexible CLI tools", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
98398
1216