Rename configuration file to cobra-cli.yaml#6
Conversation
|
LGTM to me. Since its a behavior change on before a release I'll defer the merging to the (already) tagged folks. |
| } | ||
|
|
||
| func initConfig() { | ||
| viper.AutomaticEnv() |
There was a problem hiding this comment.
is there a reason this was moved above config file loading? I'm not familiar with what this does, but if possible, I'd like to keep this PR scoped to just the config file changes
There was a problem hiding this comment.
The call to viper.AutomaticEnv() was originally done before the call to viper.ReadInConfig() and since I moved the latter to within the if/else logic, I moved the viper.AutomaticEnv() higher up to avoid duplicating it. But I can keep it closer to viper.ReadInConfig() by coding it twice.
|
Thanks @liggitt for realizing that I missed the dot-prefix for all the config file references! |
515d607 to
35b8f75
Compare
With the renaming of the generator to cobra-cli, this commit also renames the configuration file as ".cobra-cli.yaml". For backwards- compatibility, if "$HOME/.cobra-cli.yaml" can't be read, we fallback to "$HOME/.cobra.yaml". Co-authored-by: Jordan Liggitt <jordan@liggitt.net> Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
35b8f75 to
abd44aa
Compare
|
Should we go ahead and merge this since the v1.3.0 release is done? |
|
This PR is being marked as stale due to a long period of inactivity |
|
@marckhouzam |
|
This PR is being marked as stale due to a long period of inactivity |
|
This PR is being marked as stale due to a long period of inactivity |
|
This PR is being marked as stale due to a long period of inactivity |
|
This PR is being marked as stale due to a long period of inactivity |
|
This PR is being marked as stale due to a long period of inactivity |
|
@marckhouzam - if you're feeling good with this one, let's go ahead and merge it 👀 |
|
Thanks @jpmcb. I'll rebase then merge |
During the discussion about creating the
cobra-clirepo @spf13 hinted that we should rename the configuration file tocobra-cli.yamlbut keep supporting thecobra.yamlname as a fallback. Please see spf13/cobra#1597 (comment)This PR does this. If a different approach is preferred, just let me know.
/cc @liggitt @jpmcb