Skip to content

Commit

Permalink
feat: generated files log (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimulaco committed Apr 11, 2020
1 parent f40dcd8 commit 9aae26c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ module.exports = async function (moduleOptions) {

options.forEach((feedOptions, index) => {
this.nuxt.hook('generate:done', async () => {
if (index === 0) {
logger.info('Generating feeds')
}

const xmlGeneratePath = resolve(this.options.rootDir, join(this.options.generate.dir, feedOptions.path))

writeFileSync(xmlGeneratePath, await feedCache.get(index))

logger.success('Generated', feedOptions.path)
})

this.addServerMiddleware({
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"scripts": {
"dev": "nuxt test/fixture",
"generate": "nuxt generate test/fixture",
"lint": "eslint --ext .js,.vue lib test",
"test": "yarn lint && jest",
"release": "yarn test && standard-version && git push --follow-tags && npm publish"
Expand Down

0 comments on commit 9aae26c

Please sign in to comment.