tauri/cli/tauri.js/entry.js

14 lines
498 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) => {
// this MUST be from the templates repo
2019-11-29 09:27:26 +03:00
const apiTemplate = readFileSync(path.resolve(__dirname, './templates/tauri.js'), 'utf-8')
const apiContent = compileTemplate(apiTemplate)(cfg)
ensureDir(outDir).then(() => {
writeFileSync(path.join(outDir, 'tauri.js'), apiContent, 'utf-8')
})
}