1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-07-09 19:51:07 +01:00

CONVERT: Improve command consistency.

This commit is contained in:
hacksalot
2018-01-30 02:34:58 -05:00
parent 6b125ed907
commit c913de4bf7
19 changed files with 208 additions and 50 deletions

View File

@ -262,7 +262,7 @@ execute = ( src, dst, opts, log ) ->
v = new HMR.verbs[ @name() ]()
# Initialize command-specific options
loadOptions.call( this, opts, this.parent.jsonArgs )
loadOptions.call this, opts, this.parent.jsonArgs
# Set up error/output handling
_opts.errHandler = v
@ -288,9 +288,15 @@ executeSuccess = (obj) ->
### Failure handler for verb invocations. Calls process.exit by default ###
executeFail = (err) ->
console.dir err
finalErrorCode = -1
if err
finalErrorCode = if err.fluenterror then err.fluenterror else err
if err.fluenterror
finalErrorCode = err.fluenterror
else if err.length
finalErrorCode = err[0].fluenterror
else
finalErrorCode = err
if _opts.debug
msgs = require('./msg').errors;
logMsg printf M2C( msgs.exiting.msg, 'cyan' ), finalErrorCode