feat(cli): warning when logged in and using token at the same time

This commit is contained in:
Daniel Hougaard
2024-09-18 01:34:01 +04:00
parent 9b2565e387
commit 3e79dbb3f5
9 changed files with 87 additions and 33 deletions

View File

@@ -44,6 +44,7 @@ func init() {
rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
silent, err := cmd.Flags().GetBool("silent")
config.INFISICAL_URL = util.AppendAPIEndpoint(config.INFISICAL_URL)
if err != nil {
util.HandleError(err)
}
@@ -51,6 +52,8 @@ func init() {
if !util.IsRunningInDocker() && !silent {
util.CheckForUpdate()
}
config.INFISICAL_SILENT_MODE = silent
}
// if config.INFISICAL_URL is set to the default value, check if INFISICAL_URL is set in the environment