Skip to content

Commit

Permalink
Use different tags when scaffolding with ejs. Fixes fabiocaseri#12
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaseri committed Dec 9, 2013
1 parent 5024016 commit 658ea5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module.exports = function(dirIn, dirOut, options, callback) {
// Which consolidate-supported templating engine to use.
options.engine = options.engine || 'handlebars';

options.engine_opts = options.engine_opts || {};

// Which extension hardhat should apply templating to.
// HardHat will run '*.[ext]'' files through the templating engine and
// remove '.[ext]' from the resulting file.
Expand All @@ -56,6 +58,10 @@ module.exports = function(dirIn, dirOut, options, callback) {

options.filterFile = options.filterFile || function(){return true};

for (var key in options.engine_opts) {
options.data[key] = options.engine_opts[key];
}

// Ensure dirIn exists.
if (!fs.existsSync(dirIn)) {
return callback(new Error('The input directory does not exist (' + dirIn + ').'));
Expand Down
4 changes: 4 additions & 0 deletions lib/thor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ exports.Thor = {

scaffold([this.source_root, src].join(path.sep), dest, {
engine: 'ejs',
engine_opts: {
open: '{{',
close: '}}'
},
ext: 'tt',
namepre: '%',
namesuf: '%',
Expand Down

0 comments on commit 658ea5a

Please sign in to comment.