Clean up CoffeeScript.

This commit is contained in:
hacksalot 2016-02-13 00:40:10 -05:00
parent dbef9f0a35
commit 9927e79900
2 changed files with 13 additions and 12 deletions

View File

@ -90,12 +90,12 @@ module.exports = class TemplateGenerator extends BaseGenerator
generate: ( rez, f, opts ) ->
# Prepare
@opts = EXTEND( true, { }, _defaultOpts, opts );
@opts = EXTEND true, { }, _defaultOpts, opts
# Call the string-based generation method to perform the generation.
genInfo = this.invoke( rez, null )
# Call the string-based generation method
genInfo = @invoke rez, null
outFolder = parsePath( f ).dirname
curFmt = opts.themeObj.getFormat( this.format )
curFmt = opts.themeObj.getFormat @format
# Process individual files within this format. For example, the HTML
# output format for a theme may have multiple HTML files, CSS files,

View File

@ -215,17 +215,18 @@ _single = ( targInfo, theme, finished ) ->
@stat HMEVENT.beforeGenerate,
fmt: targInfo.fmt.outFormat
file: PATH.relative(process.cwd(), f)
file: PATH.relative process.cwd(), f
_opts.targets = finished;
_opts.targets = finished
# If targInfo.fmt.files exists, this format is backed by a document.
# Fluent/FRESH themes are handled here.
if targInfo.fmt.files && targInfo.fmt.files.length
theFormat = _fmts.filter(
(fmt) -> return fmt.name == targInfo.fmt.outFormat )[0];
MKDIRP.sync( PATH.dirname( f ) ); # Ensure dest folder exists;
ret = theFormat.gen.generate( _rezObj, f, _opts );
theFormat = _fmts.filter( (fmt) ->
return fmt.name == targInfo.fmt.outFormat
)[0];
MKDIRP.sync PATH.dirname( f )
ret = theFormat.gen.generate _rezObj, f, _opts
# Otherwise this is an ad-hoc format (JSON, YML, or PNG) that every theme
# gets "for free".
@ -242,8 +243,8 @@ _single = ( targInfo, theme, finished ) ->
ex = e
this.stat HMEVENT.afterGenerate,
fmt: targInfo.fmt.outFormat,
file: PATH.relative( process.cwd(), f ),
fmt: targInfo.fmt.outFormat
file: PATH.relative process.cwd(), f
error: ex
if ex