tauri/mode/entry.js
nothingismagick b93bded180
feat(cli) [WIP] (#34)
* feat(cli) init tauri mode

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cli:init) add force & logging flags, full JSDoc

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cli:init) remove console.log

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cli:dev) get rust compile to finish

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cli:build) get rust compile to finish

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cli) set template with current working defaults

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* chore(version) bump

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(typo)

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(template): missing name warning

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(bundler): correct repository link

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(lib|cli) read config from tauriDir

* chore(cli) remove console.log statement

* fix(embedded-server) JS content type

* feat(template): add rust2018 flag

* feat(cli): cleanup
2019-10-07 20:36:56 +02:00

15 lines
488 B
JavaScript

const compileTemplate = require('lodash.template'),
{ readFileSync, writeFileSync, ensureDir } = require('fs-extra'),
path = require('path')
module.exports.generate = (outDir, cfg) => {
const apiTemplate = readFileSync(path.resolve(__dirname, '../lib/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')
})
}