Skip to content

Commit

Permalink
Change INFISICAL_URL to API_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Jan 21, 2023
1 parent 74fb64b commit 7a6230f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cli/packages/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ func Execute() {
func init() {
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
rootCmd.PersistentFlags().BoolVarP(&debugLogging, "debug", "d", false, "Enable verbose logging")
rootCmd.PersistentFlags().StringVar(&config.INFISICAL_URL, "domain", util.INFISICAL_DEFAULT_URL, "Point the CLI to your own backend [ENV: INFISICAL_URL]")
rootCmd.PersistentFlags().StringVar(&config.INFISICAL_URL, "domain", util.INFISICAL_DEFAULT_API_URL, "Point the CLI to your own backend [can also set via environment variable name: API_URL]")
// rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
// }

// 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 !rootCmd.Flag("domain").Changed {
if envInfisicalURL, ok := os.LookupEnv("INFISICAL_URL"); ok {
config.INFISICAL_URL = envInfisicalURL
if envInfisicalBackendUrl, ok := os.LookupEnv("API_URL"); ok {
config.INFISICAL_URL = envInfisicalBackendUrl
}
}

}

0 comments on commit 7a6230f

Please sign in to comment.