-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
Running ghost config
without params appears to wipe database
#1896
Comments
I'll probably take a look tomorrow |
Was your db set to a non-default path by chance? Calling config without any arguments (incorrectly) runs |
I have accidentally triggered this behavior. Will see if I can do so again. :) (It's very possible that config with the wrong arguments looks a lot like deleting... Yeah, I think it's an accidental switch of database location, causing a reinitialization of the db. Which is better than a data wipe, to be sure.) |
ok I replicated this locally and figured out what's going on: step 1 - outputs this config.development.json:
then running
so the sqlite db path is getting changed from there's definitely a quick fix here to avoid changing the db path, but I'm wondering if there isn't a better way to have the |
Channeling my noob self (some of you may assert that I do this all of the time...) I might type Walking through all the options would be OK (with existing config given), but it might be equally helpful if the output told me that Ghost was already at least partially configured and provided the output of ghost config --help, so that I could pick the option I was actually wanting, rather than walking through them all. The current output of |
hmm that's not a bad option - if no args are passed, simply output the available config args with the current values in the config if set that fixes half of the issue, the other half is to make it so the "default" values for those flags are derived from the config if it already exists, so that if you run Should be able to get a PR up for this tomorrow or Friday |
@acburdine #1902 is a draft for the first half - feel free to take it over. I was thinking the same thing for the second half - we don't have a simple way right now to detect if the default value was used or the user passed the default value (I think). Does it make sense that a fresh install defaults to |
Summary
It seems that typing 'ghost config' without an argument, at least while in development mode, apparently wipes the database and resets everything. This is very unexpected
Steps to Reproduce
ghost config
without a paramIf arguments are required, the command should output some help, not perform a distructive action
The text was updated successfully, but these errors were encountered: