tauri/cli/tauri.js/bin/tauri-init.js
Noah Klayman fab788b4bd [needs review] Convert tauri.js to typescript (#203)
* feat(tauri.js): move to typescript

* fix(tauri.js): properly export api as commonjs

* feat(tauri.js): convert tauricon to typescript

* fix(tauri.js/tauricon): type error

* chore(tauri.js/package): update yarn.lock

* chore(tauri.js/package): add build/pretest scripts

* refactor(tauri.js/template): remove duplicate types

* chore(tauri.js) lint-fix

* fix(tauri.js) build tauricon.ts

* chore(tauri.js) remove unused code

Co-authored-by: nothingismagick <drthompsonsmagickindustries@gmail.com>
Co-authored-by: Lucas Fernandes Nogueira <lucasfernandesnog@gmail.com>
2019-12-24 09:40:03 -03:00

50 lines
1.1 KiB
JavaScript

const parseArgs = require('minimist')
/**
* @type {object}
* @property {boolean} h
* @property {boolean} help
* @property {string|boolean} f
* @property {string|boolean} force
* @property {boolean} l
* @property {boolean} log
* @property {boolean} d
* @property {boolean} directory
*/
const argv = parseArgs(process.argv.slice(2), {
alias: {
h: 'help',
f: 'force',
l: 'log',
d: 'directory',
t: 'tauri-path'
},
boolean: ['h', 'l']
})
if (argv.help) {
console.log(`
Description
Inits the Tauri template. If Tauri cannot find the tauri.conf.js
it will create one.
Usage
$ tauri init
Options
--help, -h Displays this message
--force, -f Force init to overwrite [conf|template|all]
--log, -l Logging [boolean]
--directory, -d Set target directory for init
--tauri-path, -t Path of the Tauri project to use (relative to the cwd)
`)
process.exit(0)
}
const init = require('../dist/init')
init({
directory: argv.d || process.cwd(),
force: argv.f || null,
logging: argv.l || null,
tauriPath: argv.t || null
})