From 830c36818eb599c6e1c82ebcd38732c40ce5ece1 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Wed, 6 Jan 2016 14:15:27 -0500 Subject: [PATCH] Tweak missing file message for "new" command. --- src/index.js | 3 ++- src/verbs/create.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index f593dd4..b2c2e64 100644 --- a/src/index.js +++ b/src/index.js @@ -152,7 +152,8 @@ function initialize() { // Override the .missingArgument behavior Command.prototype.missingArgument = function(name) { - throw { fluenterror: HACKMYSTATUS.resumeNotFound }; + if( this.name() !== 'new' ) + throw { fluenterror: HACKMYSTATUS.resumeNotFound }; }; // Override the .helpInformation behavior diff --git a/src/verbs/create.js b/src/verbs/create.js index a405949..dd78407 100644 --- a/src/verbs/create.js +++ b/src/verbs/create.js @@ -8,14 +8,15 @@ Implementation of the 'create' verb for HackMyResume. var MKDIRP = require('mkdirp') , PATH = require('path') - , chalk = require('chalk'); + , chalk = require('chalk') + , HACKMYSTATUS = require('../core/status-codes'); /** Create a new empty resume in either FRESH or JRS format. */ module.exports = function create( src, dst, opts, logger ) { var _log = logger || console.log; - if( !src || !src.length ) throw { fluenterror: 8 }; + if( !src || !src.length ) throw { fluenterror: HACKMYSTATUS.createNameMissing }; src.forEach( function( t ) { var safeFormat = opts.format.toUpperCase(); _log(chalk.green('Creating new ') + chalk.green.bold(safeFormat) +