diff --git a/src/generators/template-generator.coffee b/src/generators/template-generator.coffee index 92b96a3..fd3e4f0 100644 --- a/src/generators/template-generator.coffee +++ b/src/generators/template-generator.coffee @@ -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, diff --git a/src/verbs/build.coffee b/src/verbs/build.coffee index 598d765..62fe9a8 100644 --- a/src/verbs/build.coffee +++ b/src/verbs/build.coffee @@ -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