mirror of
https://github.com/yannbertrand/macos-defaults
synced 2024-12-15 22:22:31 +00:00
14 lines
481 B
JavaScript
14 lines
481 B
JavaScript
const fs = require('fs')
|
|
const Handlebars = require('handlebars')
|
|
|
|
Handlebars.registerHelper('lowerCase', (string) => {
|
|
return string.toLowerCase()
|
|
})
|
|
|
|
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)
|
|
}
|