We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd680c8 commit 910ba25Copy full SHA for 910ba25
pkg/cmd/root.go
@@ -81,9 +81,15 @@ func initConfig() {
81
for _, path := range strings.Split(os.ExpandEnv("$PATH"), ":") {
82
viper.AddConfigPath(path)
83
}
84
+
85
viper.SetEnvPrefix(constants.DEFAULT_ENV_PREFIX)
86
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
87
viper.AutomaticEnv()
88
89
+ // Explicitly bind environment variables without the JR_ prefix
90
+ viper.BindEnv("jr_system_dir", "JR_SYSTEM_DIR")
91
+ viper.BindEnv("jr_user_dir", "JR_USER_DIR")
92
93
bindFlags(rootCmd, viper.GetViper())
94
if constants.JR_SYSTEM_DIR == "" {
95
constants.JR_SYSTEM_DIR = constants.SYSTEM_DIR
0 commit comments