-
Notifications
You must be signed in to change notification settings - Fork 15
Config file is being saved on every invocation of the CLI #153
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
Comments
Hi @Kumm-Kai, |
Great, thanks for looking into it @joaopalet ❤️ |
#185 doesn't completely solve this issue. A empty file is still being created on the very first invocation. If you want to I can open a PR for it. |
Ah good point, I though the issue was only in If you want to raise the PR making the fix I would be happy to review and support, otherwise I will try to do it within the next few days. |
Currently, the STACKIT CLI calls the
config.InitConfig
function on every invocation.On the very first call of the binary (no
.stackit
directory exists), it creates the directory and a config file (with default values).On every following binary call the config file is being read and directly written to disk again.
This is probably only problematic in some small edge cases, like calling
stackit
multiple times in one command usingprocess substiution
(e.g.,<(stackit xyz)
). In this case the CLI fails becauseviper.WriteConfigAs
is not concurrency-safe.This can be solved by either:
stackit config set/unset
From my point of view the first solution would be the best one because in my opinion there is no need to create a config file if the user didn't change the defaults.
The text was updated successfully, but these errors were encountered: