fix edge case of input same as default clobber env

This commit is contained in:
Ashley Hutson
2023-01-21 01:05:25 -08:00
parent 3af85f9fba
commit 74fb64bbb9

View File

@ -38,9 +38,10 @@ func init() {
// if config.INFISICAL_URL is set to the default value, check if INFISICAL_URL is set in the environment
// this is used to allow overrides of the default value
if config.INFISICAL_URL == util.INFISICAL_DEFAULT_URL {
if !rootCmd.Flag("domain").Changed {
if envInfisicalURL, ok := os.LookupEnv("INFISICAL_URL"); ok {
config.INFISICAL_URL = envInfisicalURL
}
}
}