Skip to content

Commit

Permalink
fix(prompt): respect --no-prompt option in other areas
Browse files Browse the repository at this point in the history
closes #276, refs #280
- fix various instances where the --no-prompt option was not correctly respected,  resulting in an error
  • Loading branch information
acburdine committed Jul 6, 2017
1 parent 78f8439 commit fb7e4f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/commands/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ class ConfigCommand extends Command {
return Promise.resolve();
}

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

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UninstallCommand extends Command {
run(argv) {
let prompt;

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

Expand Down

0 comments on commit fb7e4f7

Please sign in to comment.