quiet mode for init
This commit is contained in:
parent
c2c4f5b174
commit
f61757698e
|
@ -13,10 +13,10 @@ module.exports = {
|
||||||
})
|
})
|
||||||
yargs.positional("database", {
|
yargs.positional("database", {
|
||||||
type: "string",
|
type: "string",
|
||||||
describe: "database to use usually couch for dev",
|
describe: "use a local (PouchDB) or remote (CouchDB) database",
|
||||||
alias: "b",
|
alias: "b",
|
||||||
default: "pouch",
|
default: "local",
|
||||||
choices: ["pouch", "couch"],
|
choices: ["local", "remote"],
|
||||||
})
|
})
|
||||||
yargs.positional("clientId", {
|
yargs.positional("clientId", {
|
||||||
type: "string",
|
type: "string",
|
||||||
|
@ -30,6 +30,12 @@ module.exports = {
|
||||||
alias: "x",
|
alias: "x",
|
||||||
default: "",
|
default: "",
|
||||||
})
|
})
|
||||||
|
yargs.positional("quiet", {
|
||||||
|
type: "boolean",
|
||||||
|
describe: "flag - if set, then run in quiet mode - use all defaults",
|
||||||
|
alias: "q",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handler,
|
handler,
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ const createClientDatabse = async opts => {
|
||||||
|
|
||||||
const createDevEnvFile = async opts => {
|
const createDevEnvFile = async opts => {
|
||||||
const destConfigFile = join(opts.dir, "./.env")
|
const destConfigFile = join(opts.dir, "./.env")
|
||||||
let createConfig = !(await exists(destConfigFile))
|
let createConfig = !(await exists(destConfigFile)) || opts.quiet
|
||||||
if (!createConfig) {
|
if (!createConfig) {
|
||||||
const answers = await inquirer.prompt([
|
const answers = await inquirer.prompt([
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue