Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Override project name with destination directory name.
  • Loading branch information
zigomir committed Apr 27, 2016
commit eb2d921294fce52f4365bd4dce07506b4e93ef30
4 changes: 3 additions & 1 deletion lib/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var path = require('path')
var getOptions = require('./options')
var ask = require('./ask')
var filter = require('./filter')
var extend = Object.assign || require('util')._extend

// register hendlebars helper
Handlebars.registerHelper('if_eq', function (a, b, opts) {
Expand All @@ -32,7 +33,8 @@ Handlebars.registerHelper('unless_eq', function (a, b, opts) {
module.exports = function generate (name, src, dest, done) {
var opts = getOptions(name, src)
var metalsmith = Metalsmith(path.join(src, 'template'))
var data = metalsmith.metadata()
// extract all gathered data from user and override project name with destination directory name
var data = extend({}, metalsmith.metadata(), { name: name })
// avoid handlebars escaping HTML
data.noEscape = true
metalsmith
Expand Down