1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-03 21:07:07 +01:00

Support --assert option for validate command.

Cause HMR to return an error code if validation fails and the --assert
option is present.
This commit is contained in:
hacksalot
2016-01-06 00:44:34 -05:00
parent f61deda4e8
commit 2d20077c08
4 changed files with 17 additions and 5 deletions

View File

@ -20,8 +20,7 @@ Error-handling routines for HackMyResume.
/**
An amorphous blob of error handling code for HackMyResume. Have an error?
Stick it here. We don't mind.
An amorphous blob of error handling code for HackMyResume.
@class ErrorHandler
*/
var ErrorHandler = module.exports = {
@ -37,8 +36,10 @@ Error-handling routines for HackMyResume.
return;
}
if( ex.fluenterror ){
switch( ex.fluenterror ) { // TODO: Remove magic numbers
switch( ex.fluenterror ) {
case HACKMYSTATUS.themeNotFound:
msg = "The specified theme couldn't be found: " + ex.data;
@ -89,6 +90,9 @@ Error-handling routines for HackMyResume.
'installed and accessible from your path.');
break;
case HACKMYSTATUS.invalid:
msg = chalk.red.bold('ERROR: Validation failed and the --assert option was specified.');
break;
}
exitCode = ex.fluenterror;

View File

@ -17,7 +17,8 @@ Status codes for HackMyResume.
inputOutputParity: 7,
createNameMissing: 8,
wkhtmltopdf: 9,
missingPackageJSON: 10
missingPackageJSON: 10,
invalid: 11
};
}());