1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-05 01:56:21 +00:00

Fix output glitches.

This commit is contained in:
hacksalot 2016-01-26 14:43:48 -05:00
parent 9f811336e4
commit 15a0af8410
2 changed files with 13 additions and 19 deletions

14
dist/cli/out.js vendored
View File

@ -52,7 +52,7 @@ Output routines for HackMyResume.
return this.opts.silent || console.log(finished);
},
"do": function(evt) {
var L, WRAP, info, msg, numFormats, output, rawTpl, ref, ref1, ref2, sty, style, suffix, template, that, themeName, tot;
var L, WRAP, info, msg, numFormats, output, rawTpl, sty, style, suffix, template, that, themeName, tot;
that = this;
L = function() {
return that.log.apply(that, arguments);
@ -72,15 +72,11 @@ Output routines for HackMyResume.
evt.f.reverse().forEach(function(a, idx) {
return msg += printf((idx === 0 ? this.msgs.beforeMerge.msg[0] : this.msgs.beforeMerge.msg[1]), a.file);
}, this);
return L(M2C(msg, (ref = evt.mixed) != null ? ref : {
'yellow': 'gray'
}, 'white.dim'));
return L(M2C(msg, (evt.mixed ? 'yellow' : 'gray'), 'white.dim'));
case HME.applyTheme:
this.theme = evt.theme;
numFormats = Object.keys(evt.theme.formats).length;
return L(M2C(this.msgs.applyTheme.msg, evt.status === 'error' ? 'red' : 'gray', evt.status === 'error' ? 'bold' : 'white.dim'), evt.theme.name.toUpperCase(), numFormats, (ref1 = numFormats === 1) != null ? ref1 : {
'': 's'
});
return L(M2C(this.msgs.applyTheme.msg, evt.status === 'error' ? 'red' : 'gray', evt.status === 'error' ? 'bold' : 'white.dim'), evt.theme.name.toUpperCase(), numFormats, numFormats === 1 ? '' : 's');
case HME.end:
if (evt.cmd === 'build') {
themeName = this.theme.name.toUpperCase();
@ -131,9 +127,7 @@ Output routines for HackMyResume.
case HME.afterInlineConvert:
return L(M2C(this.msgs.afterInlineConvert.msg, 'gray', 'white.dim'), evt.file, evt.fmt);
case HME.afterValidate:
style = (ref2 = evt.isValid) != null ? ref2 : {
'green': 'yellow'
};
style = evt.isValid ? 'green' : 'yellow';
L(M2C(this.msgs.afterValidate.msg[0], 'white') + chalk[style].bold(evt.isValid ? this.msgs.afterValidate.msg[1] : this.msgs.afterValidate.msg[2]), evt.file, evt.fmt);
if (evt.errors) {
return _.each(evt.errors, function(err, idx) {

View File

@ -47,25 +47,25 @@ OutputHandler = module.exports = Class.extend
when HME.begin
this.opts.debug &&
L( M2C( this.msgs.begin.msg, dbgStyle), evt.cmd.toUpperCase() );
L( M2C( this.msgs.begin.msg, dbgStyle), evt.cmd.toUpperCase() )
when HME.beforeCreate
L( M2C( this.msgs.beforeCreate.msg, 'green' ), evt.fmt, evt.file );
L( M2C( this.msgs.beforeCreate.msg, 'green' ), evt.fmt, evt.file )
break;
when HME.beforeTheme
this.opts.debug &&
L( M2C( this.msgs.beforeTheme.msg, dbgStyle), evt.theme.toUpperCase() );
L( M2C( this.msgs.beforeTheme.msg, dbgStyle), evt.theme.toUpperCase() )
when HME.afterParse
L( M2C( this.msgs.afterRead.msg, 'gray', 'white.dim'), evt.fmt.toUpperCase(), evt.file );
L( M2C( this.msgs.afterRead.msg, 'gray', 'white.dim'), evt.fmt.toUpperCase(), evt.file )
when HME.beforeMerge
msg = ''
evt.f.reverse().forEach( ( a, idx ) ->
evt.f.reverse().forEach ( a, idx ) ->
msg += printf( (if idx == 0 then @msgs.beforeMerge.msg[0] else @msgs.beforeMerge.msg[1]), a.file )
, @);
L( M2C(msg, evt.mixed ? 'yellow' : 'gray', 'white.dim') )
, @
L( M2C(msg, (if evt.mixed then 'yellow' else 'gray'), 'white.dim') )
when HME.applyTheme
@theme = evt.theme;
@ -74,7 +74,7 @@ OutputHandler = module.exports = Class.extend
if evt.status == 'error' then 'red' else 'gray',
if evt.status == 'error' then 'bold' else 'white.dim'),
evt.theme.name.toUpperCase(),
numFormats, ( numFormats == 1 ? '' : 's') )
numFormats, if numFormats == 1 then '' else 's' )
when HME.end
if evt.cmd == 'build'
@ -126,7 +126,7 @@ OutputHandler = module.exports = Class.extend
evt.file, evt.fmt );
when HME.afterValidate
style = evt.isValid ? 'green' : 'yellow'
style = if evt.isValid then 'green' else 'yellow'
L(
M2C( this.msgs.afterValidate.msg[0], 'white' ) +
chalk[style].bold(