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

ghost config --no-prompt causes error #280

Closed
ErisDS opened this issue Jul 5, 2017 · 1 comment
Closed

ghost config --no-prompt causes error #280

ErisDS opened this issue Jul 5, 2017 · 1 comment
Labels

Comments

@ErisDS
Copy link
Member

ErisDS commented Jul 5, 2017

This is very similar to #276 (ghost uninstall throws the same error) and also related to #232 (mail config issue)

If I try to run ghost config with only mail settings, and the --no-prompt flag, I get an error.

I think this is probably also related to #268 (pre loading config)

In this case, I've already run setup, want to now set the mail config as additional properties.

There is a case that says that if db & url are set, or all the values that are prompted for are set, don't prompt: https://github.com/TryGhost/Ghost-CLI/blob/master/lib/commands/config/index.js#L122

But I think if --no-prompt is set, it shouldn't prompt either?

I guess the logic we need here is something like:

When attempting to either run config directly,

  • by default, prompt for the main values
  • if no prompt is set, just run the advanced config handling with whatever info we've got

The flip side is:

When attempting to run a setup step without a value being either passed in or ALREADY in config, then:

  • if it's ok to prompt, prompt for missing info
  • otherwise throw an error

I think?

ghost config --mail SMTP --mailservice Mailgun --mailuser postmaster@domain --mailpass xxx --no-prompt
/usr/lib/node_modules/ghost-cli/node_modules/yargs/yargs.js:1079
      else throw err
           ^

Error: Prompts have been disabled, please provide options via command line flags
    at UI.prompt (/usr/lib/node_modules/ghost-cli/lib/ui/index.js:116:19)
    at ConfigCommand.run (/usr/lib/node_modules/ghost-cli/lib/commands/config/index.js:126:24)
    at Function._run (/usr/lib/node_modules/ghost-cli/lib/command.js:183:48)
    at Object.handler (/usr/lib/node_modules/ghost-cli/lib/command.js:108:22)
    at Object.self.runCommand (/usr/lib/node_modules/ghost-cli/node_modules/yargs/lib/command.js:233:22)
    at Object.Yargs.self._parseArgs (/usr/lib/node_modules/ghost-cli/node_modules/yargs/yargs.js:990:30)
    at Object.Yargs.self.parse (/usr/lib/node_modules/ghost-cli/node_modules/yargs/yargs.js:532:23)
    at Object.run (/usr/lib/node_modules/ghost-cli/lib/bootstrap.js:153:14)
    at Object.<anonymous> (/usr/lib/node_modules/ghost-cli/bin/ghost:12:11)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
@ErisDS ErisDS added the bug label Jul 5, 2017
@ghost
Copy link

ghost commented Jul 5, 2017

yup - that sounds like a good solution 👍

acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 5, 2017
closes TryGhost#276, refs TryGhost#280
- fix various instances where the --no-prompt option was not correctly respected,  resulting in an error
acburdine added a commit that referenced this issue Jul 6, 2017
closes #276, refs #280
- fix various instances where the --no-prompt option was not correctly respected,  resulting in an error
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 10, 2017
closes TryGhost#280, closes TryGhost#268, refs TryGhost#317
- handle prompts better, don't prompt for mysql info if the user has specified sqlite
- don't prompt for URL if user has provided it
@ErisDS ErisDS closed this as completed in 8cdbad4 Jul 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant