tauri/cli/tauri.js/entry.js

15 lines
499 B
JavaScript
Raw Normal View History

const compileTemplate = require('lodash.template')
const { readFileSync, writeFileSync, ensureDir } = require('fs-extra')
const path = require('path')
module.exports.generate = (outDir, cfg) => {
2019-11-29 09:27:26 +03:00
const apiTemplate = readFileSync(path.resolve(__dirname, './templates/tauri.js'), 'utf-8')
const apiContent = compileTemplate(apiTemplate)({
...cfg,
confName: 'tauri.conf.js'
})
ensureDir(outDir).then(() => {
writeFileSync(path.join(outDir, 'tauri.js'), apiContent, 'utf-8')
})
}