mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-22 08:20:11 +00:00
Move CLI-related assets to subfolder.
This commit is contained in:
parent
bece335a64
commit
c5b8eec33a
@ -10,18 +10,18 @@ Definition of the `main` function.
|
||||
|
||||
|
||||
|
||||
var HMR = require( './hackmyapi')
|
||||
, PKG = require('../package.json')
|
||||
var HMR = require( '../hackmyapi')
|
||||
, PKG = require('../../package.json')
|
||||
, FS = require('fs')
|
||||
, EXTEND = require('./utils/extend')
|
||||
, EXTEND = require('../utils/extend')
|
||||
, chalk = require('chalk')
|
||||
, PATH = require('path')
|
||||
, HACKMYSTATUS = require('./core/status-codes')
|
||||
, HME = require('./core/event-codes')
|
||||
, safeLoadJSON = require('./utils/safe-json-loader')
|
||||
, HACKMYSTATUS = require('../core/status-codes')
|
||||
, HME = require('../core/event-codes')
|
||||
, safeLoadJSON = require('../utils/safe-json-loader')
|
||||
, _opts = { }
|
||||
, title = chalk.white.bold('\n*** HackMyResume v' + PKG.version + ' ***')
|
||||
, StringUtils = require('./utils/string.js')
|
||||
, StringUtils = require('../utils/string.js')
|
||||
, _ = require('underscore')
|
||||
, OUTPUT = require('./out')
|
||||
, Command = require('commander').Command;
|
||||
@ -152,7 +152,8 @@ Definition of the `main` function.
|
||||
|
||||
// Override the .helpInformation behavior
|
||||
Command.prototype.helpInformation = function() {
|
||||
var manPage = FS.readFileSync( PATH.join(__dirname, 'use.txt'), 'utf8' );
|
||||
var manPage = FS.readFileSync(
|
||||
PATH.join(__dirname, 'use.txt'), 'utf8' );
|
||||
return chalk.green.bold(manPage);
|
||||
};
|
||||
|
||||
@ -167,7 +168,7 @@ Definition of the `main` function.
|
||||
function execVerb( src, dst, opts, log ) {
|
||||
|
||||
loadOptions.call( this, opts );
|
||||
require( './core/error-handler' ).init( _opts.debug );
|
||||
require( '../core/error-handler' ).init( _opts.debug );
|
||||
var out = new OUTPUT( _opts );
|
||||
var v = new HMR.verbs[ this.name() ]();
|
||||
v.on( 'hmr:status', function() { out.do.apply( out, arguments ); });
|
@ -11,16 +11,16 @@ Output routines for HackMyResume.
|
||||
|
||||
|
||||
var chalk = require('chalk')
|
||||
, HME = require('./core/event-codes')
|
||||
, HME = require('../core/event-codes')
|
||||
, _ = require('underscore')
|
||||
, Class = require('./utils/class.js')
|
||||
, Class = require('../utils/class.js')
|
||||
, PATH = require('path')
|
||||
, pad = require('string-padding');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
A stateful output handler.
|
||||
A stateful output handler. All HMR console output handled here.
|
||||
*/
|
||||
var OutputHandler = module.exports = Class.extend({
|
||||
|
@ -107,7 +107,7 @@ Error-handling routines for HackMyResume.
|
||||
}).join( chalk.yellow(', ')) + chalk.yellow(").\n\n");
|
||||
|
||||
msg += chalk.gray(FS.readFileSync(
|
||||
PATH.resolve(__dirname, '../use.txt'), 'utf8' ));
|
||||
PATH.resolve(__dirname, '../cli/use.txt'), 'utf8' ));
|
||||
break;
|
||||
|
||||
case HACKMYSTATUS.invalidCommand:
|
||||
|
@ -13,7 +13,7 @@ Command-line interface (CLI) for HackMyResume.
|
||||
|
||||
try {
|
||||
|
||||
var main = require('./main');
|
||||
var main = require('./cli/main');
|
||||
main( process.argv );
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
var chai = require('chai')
|
||||
, expect = chai.expect
|
||||
, HMRMAIN = require('../src/main')
|
||||
, HMRMAIN = require('../src/cli/main')
|
||||
, CHALK = require('chalk')
|
||||
, FS = require('fs')
|
||||
, PATH = require('path')
|
||||
@ -32,7 +32,7 @@ describe('Testing Ouput interface', function () {
|
||||
try {
|
||||
args.unshift( process.argv[1] );
|
||||
args.unshift( process.argv[0] );
|
||||
var HMRMAIN = require('../src/main');
|
||||
var HMRMAIN = require('../src/cli/main');
|
||||
HMRMAIN( args );
|
||||
}
|
||||
catch( ex ) {
|
||||
@ -61,7 +61,7 @@ describe('Testing Ouput interface', function () {
|
||||
|
||||
var title = '*** HackMyResume v1.5.2 ***';
|
||||
var feedMe = 'Please feed me a resume in FRESH or JSON Resume format.';
|
||||
var manPage = FS.readFileSync( PATH.resolve( __dirname, '../src/use.txt' ), 'utf8');
|
||||
var manPage = FS.readFileSync( PATH.resolve( __dirname, '../src/cli/use.txt' ), 'utf8');
|
||||
|
||||
run('HMR should output a help string when no command is specified',
|
||||
[], [ title, 'Please give me a command (BUILD, ANALYZE, VALIDATE, CONVERT, or NEW).' ]);
|
||||
|
Loading…
Reference in New Issue
Block a user