mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-18 16:11:38 +03:00
6dcccf5a8e
* fix(js-cli) resolve correct paths on `tauri init` * feat(js-cli) inject src-tauri/ as lodash template * fix(js-cli) entry paths * feat(js-cli) rename APP_URL to devPath and allow .html values * feat(js-cli) reload config when `tauri.conf.js` change detected * feat(node): update to testing * feat(template): fix phf, remove updater * feat(samples): add vanillajs * fix(templates): objectify tauri Closes #99. * fix(examples): update cargo.toml - to match signature * chore(tauri): version update * feat(workflows): fix dirs, add tokens * fix(config): more robust env checking * feat(fixture): start a testing fixture for tauri * fix(workflow): use fixture for ENV * fix(examples:vanilla): remove updater * addition to previous commit re. fixture * fix(config.rs): fix the unfix * feat(js-cli) use the new cargo-tauri-cli * chore(template) cleanup src-tauri/Cargo.toml * chore(js-cli) toml features cleanup * chore(js-cli) move edge to config > tauri * fix(js-cli) appPaths resolve() instead of join()
14 lines
498 B
JavaScript
14 lines
498 B
JavaScript
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
|
|
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')
|
|
})
|
|
}
|