macos-defaults/build/vuepress/write-homepage.js
2020-09-26 20:24:54 +02:00

10 lines
394 B
JavaScript

const fs = require('fs')
const Handlebars = require('handlebars')
module.exports = (defaults, templatesPath, destinationPath) => {
fs.mkdirSync(destinationPath)
const homeTemplate = fs.readFileSync(`${templatesPath}/home.md.handlebars`, 'utf8')
const rootReadmeContent = Handlebars.compile(homeTemplate)(defaults)
fs.writeFileSync(`${destinationPath}/readme.md`, rootReadmeContent)
}