mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-25 01:40:10 +00:00
Clean up CoffeeScript.
This commit is contained in:
parent
dbef9f0a35
commit
9927e79900
@ -90,12 +90,12 @@ module.exports = class TemplateGenerator extends BaseGenerator
|
|||||||
generate: ( rez, f, opts ) ->
|
generate: ( rez, f, opts ) ->
|
||||||
|
|
||||||
# Prepare
|
# Prepare
|
||||||
@opts = EXTEND( true, { }, _defaultOpts, opts );
|
@opts = EXTEND true, { }, _defaultOpts, opts
|
||||||
|
|
||||||
# Call the string-based generation method to perform the generation.
|
# Call the string-based generation method
|
||||||
genInfo = this.invoke( rez, null )
|
genInfo = @invoke rez, null
|
||||||
outFolder = parsePath( f ).dirname
|
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
|
# Process individual files within this format. For example, the HTML
|
||||||
# output format for a theme may have multiple HTML files, CSS files,
|
# output format for a theme may have multiple HTML files, CSS files,
|
||||||
|
@ -215,17 +215,18 @@ _single = ( targInfo, theme, finished ) ->
|
|||||||
|
|
||||||
@stat HMEVENT.beforeGenerate,
|
@stat HMEVENT.beforeGenerate,
|
||||||
fmt: targInfo.fmt.outFormat
|
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.
|
# If targInfo.fmt.files exists, this format is backed by a document.
|
||||||
# Fluent/FRESH themes are handled here.
|
# Fluent/FRESH themes are handled here.
|
||||||
if targInfo.fmt.files && targInfo.fmt.files.length
|
if targInfo.fmt.files && targInfo.fmt.files.length
|
||||||
theFormat = _fmts.filter(
|
theFormat = _fmts.filter( (fmt) ->
|
||||||
(fmt) -> return fmt.name == targInfo.fmt.outFormat )[0];
|
return fmt.name == targInfo.fmt.outFormat
|
||||||
MKDIRP.sync( PATH.dirname( f ) ); # Ensure dest folder exists;
|
)[0];
|
||||||
ret = theFormat.gen.generate( _rezObj, f, _opts );
|
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
|
# Otherwise this is an ad-hoc format (JSON, YML, or PNG) that every theme
|
||||||
# gets "for free".
|
# gets "for free".
|
||||||
@ -242,8 +243,8 @@ _single = ( targInfo, theme, finished ) ->
|
|||||||
ex = e
|
ex = e
|
||||||
|
|
||||||
this.stat HMEVENT.afterGenerate,
|
this.stat HMEVENT.afterGenerate,
|
||||||
fmt: targInfo.fmt.outFormat,
|
fmt: targInfo.fmt.outFormat
|
||||||
file: PATH.relative( process.cwd(), f ),
|
file: PATH.relative process.cwd(), f
|
||||||
error: ex
|
error: ex
|
||||||
|
|
||||||
if ex
|
if ex
|
||||||
|
Loading…
Reference in New Issue
Block a user