mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-10 07:47:07 +01:00
Cleanup.
This commit is contained in:
@ -117,7 +117,7 @@ Implementation of the 'build' verb for HackMyResume.
|
||||
|
||||
// Add freebie formats to the theme
|
||||
addFreebieFormats( theme );
|
||||
this.stat( HMEVENT.applyTheme, { r: rez });
|
||||
this.stat( HMEVENT.applyTheme, { r: rez, theme: theme });
|
||||
|
||||
// Load the resume into a FRESHResume or JRSResume object
|
||||
_rezObj = new (RTYPES[ toFormat ])().parseJSON( rez );
|
||||
@ -161,12 +161,6 @@ Implementation of the 'build' verb for HackMyResume.
|
||||
|
||||
|
||||
|
||||
function handleInternalError( ex ) {
|
||||
console.log(ex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Generate a single target resume such as "out/rez.html" or "out/rez.doc".
|
||||
TODO: Refactor.
|
||||
|
@ -4,8 +4,12 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
@license MIT. See LICENSE.md for details.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
|
||||
|
||||
var FS = require('fs');
|
||||
var ResumeFactory = require('../core/resume-factory');
|
||||
var SyntaxErrorEx = require('../utils/syntax-error-ex');
|
||||
@ -17,6 +21,7 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
|
||||
|
||||
|
||||
/** An invokable resume validation command. */
|
||||
var ValidateVerb = module.exports = Verb.extend({
|
||||
|
||||
init: function() {
|
||||
@ -33,16 +38,12 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Validate 1 to N resumes in either FRESH or JSON Resume format.
|
||||
*/
|
||||
/** Validate 1 to N resumes in FRESH or JSON Resume format. */
|
||||
function validate( sources, unused, opts ) {
|
||||
|
||||
if( !sources || !sources.length )
|
||||
throw { fluenterror: HMSTATUS.resumeNotFoundAlt, quit: true };
|
||||
|
||||
var isValid = true;
|
||||
|
||||
var validator = require('is-my-json-valid');
|
||||
var schemas = {
|
||||
fresh: require('fresca'),
|
||||
@ -82,14 +83,14 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
}
|
||||
|
||||
}
|
||||
catch(exc) {
|
||||
catch( exc ) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
this.stat(HMEVENT.afterValidate, { file: src.file, isValid: isValid,
|
||||
fmt: fmt.replace('jars', 'JSON Resume'), errors: errors });
|
||||
this.stat( HMEVENT.afterValidate, { file: src.file, isValid: ret.isValid,
|
||||
fmt: fmt.replace( 'jars', 'JSON Resume' ), errors: errors });
|
||||
|
||||
if( opts.assert && !isValid ) {
|
||||
if( opts.assert && !ret.isValid ) {
|
||||
throw { fluenterror: HMSTATUS.invalid, shouldExit: true };
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user