From 15a0af8410a229806aa4c5fd87c841309f2ce892 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Tue, 26 Jan 2016 14:43:48 -0500 Subject: [PATCH] Fix output glitches. --- dist/cli/out.js | 14 ++++---------- src/cli/out.coffee | 18 +++++++++--------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/dist/cli/out.js b/dist/cli/out.js index c342229..371f995 100644 --- a/dist/cli/out.js +++ b/dist/cli/out.js @@ -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) { diff --git a/src/cli/out.coffee b/src/cli/out.coffee index c37a9bd..1a2e9cb 100644 --- a/src/cli/out.coffee +++ b/src/cli/out.coffee @@ -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(