Skip to content

Commit fb7e4f7

Browse files
committed
fix(prompt): respect --no-prompt option in other areas
closes #276, refs #280 - fix various instances where the --no-prompt option was not correctly respected, resulting in an error
1 parent 78f8439 commit fb7e4f7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/commands/config/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ class ConfigCommand extends Command {
116116
return Promise.resolve();
117117
}
118118

119-
// If url && db are set or if
120-
// every prompt is provided in options
121-
// then skip prompts
122-
if ((argv.db && argv.url) || every(prompts.map((prompt) => prompt.name), (name) => argv[name])) {
119+
// 3 cases for skipping
120+
// 1: both db and url are provided
121+
// 2: Prompting has been disabled (via --no-prompt)
122+
// 3: All prompt values have been supplied
123+
if ((argv.db && argv.url) || !argv.prompt || every(prompts.map((prompt) => prompt.name), (name) => argv[name])) {
123124
return this.handleAdvancedOptions(argv);
124125
}
125126

lib/commands/uninstall.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class UninstallCommand extends Command {
88
run(argv) {
99
let prompt;
1010

11-
if (!argv.force) {
11+
if (!argv.force && argv.prompt) {
1212
this.ui.log('WARNING: Running this command will delete all of your themes, images, data, and any files related to this ghost instance!\n' +
1313
'There is no going back!', 'yellow');
1414

0 commit comments

Comments
 (0)