Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Commit

Permalink
feat: allow to use custom data for template interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Dec 2, 2018
1 parent 7017190 commit 6b291b5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/runActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,16 @@ module.exports = async (config, context) => {
transformer.render(
contents,
config.transformerOptions,
Object.assign({}, context.answers, {
context
})
Object.assign(
{},
context.answers,
typeof config.templateData === 'function'
? config.templateData.call(context, context)
: config.templateData,
{
context
}
)
).body
)
})
Expand Down

0 comments on commit 6b291b5

Please sign in to comment.