Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(prompt): respect --no-prompt option in other areas #286

Merged
merged 1 commit into from
Jul 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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