Skip to content

Commit

Permalink
templates: emulate __filename + __dirname globals
Browse files Browse the repository at this point in the history
  • Loading branch information
enzy committed Aug 16, 2019
1 parent 835032b commit cac09e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/tasks/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ module.exports = function(gulp, config) {
var name = path.basename(file.path)
var data = _.cloneDeep(templatesData)

data.__filename = file.path
data.__dirname = path.dirname(file.path)

// In case of name == key, assign value as global object
if(typeof templatesData[name] !== 'undefined') {
var obj = _.assign(data, templatesData[name], file.data)
Expand Down

0 comments on commit cac09e8

Please sign in to comment.