Skip to content

Commit

Permalink
Add beforeCreate event.
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Feb 29, 2020
1 parent 91e45ab commit 9ef368f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/generators/output/toDisk.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ module.exports = async (env, spinner) => {
throw RangeError(`No "${filetypes}" templates found in \`${sourceDir}\`. If the path is correct, please check your \`build.templates.filetypes\` config setting.`)
}

if (globalConfig.events && typeof globalConfig.events.beforeCreate === 'function') {
await globalConfig.events.beforeCreate(globalConfig)
}

await asyncForEach(templates, async file => {
let html = await fs.readFile(file, 'utf8')
const frontMatter = fm(html)
Expand Down

0 comments on commit 9ef368f

Please sign in to comment.