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