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

Continue moving logging out of core.

This commit is contained in:
hacksalot
2016-01-09 15:49:08 -05:00
parent 732bc9809a
commit 3aabb5028d
5 changed files with 88 additions and 51 deletions

View File

@ -12,12 +12,18 @@ Implementation of the 'convert' verb for HackMyResume.
var ResumeFactory = require('../core/resume-factory')
, chalk = require('chalk')
, Verb = require('../core/verb')
, HACKMYSTATUS = require('../core/status-codes');
, Verb = require('../core/verb')
, HACKMYSTATUS = require('../core/status-codes')
, _ = require('underscore')
, HME = require('../core/event-codes');
var ConvertVerb = module.exports = Verb.extend({
init: function() {
this._super('convert');
},
invoke: function() {
convert.apply( this, arguments );
}
@ -50,7 +56,7 @@ Implementation of the 'convert' verb for HackMyResume.
}
// Load source resumes
srcs.forEach( function( src, idx ) {
_.each(srcs, function( src, idx ) {
// Load the resume
var rinfo = ResumeFactory.loadOne( src, {
@ -62,15 +68,12 @@ Implementation of the 'convert' verb for HackMyResume.
'JRS' : 'FRESH'
, targetFormat = srcFmt === 'JRS' ? 'FRESH' : 'JRS';
// TODO: Core should not log
_log( chalk.green('Converting ') + chalk.green.bold(rinfo.file) +
chalk.green(' (' + srcFmt + ') to ') + chalk.green.bold(dst[idx]) +
chalk.green(' (' + targetFormat + ').'));
this.stat(HME.beforeConvert, { srcFile: rinfo.file, srcFmt: srcFmt, dstFile: dst[idx], dstFmt: targetFormat });
// Save it to the destination format
s.saveAs( dst[idx], targetFormat );
});
}, this);
}