From ec4d07877c63e6cddfeb75617032c5ca2ad0be1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Pavl=C3=AD=C4=8Dek?= Date: Fri, 22 Aug 2025 11:07:04 +0200 Subject: [PATCH] fix: ZEROPS_TOKEN environment variable takes precedence over stored zcli login data --- src/cmdBuilder/createRunFunc.go | 4 ++-- src/i18n/en.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmdBuilder/createRunFunc.go b/src/cmdBuilder/createRunFunc.go index 3f0e8ef..e1222a7 100644 --- a/src/cmdBuilder/createRunFunc.go +++ b/src/cmdBuilder/createRunFunc.go @@ -88,8 +88,8 @@ func createCmdRunFunc( storedData := cliStorage.Data() token := storedData.Token - if token == "" { - token = os.Getenv(constants.CliTokenEnvVar) + if envToken, ok := os.LookupEnv(constants.CliTokenEnvVar); ok { + token = envToken } if token == "" { if cmd.guestRunFunc != nil { diff --git a/src/i18n/en.go b/src/i18n/en.go index 7bc5a04..2fcdbd0 100644 --- a/src/i18n/en.go +++ b/src/i18n/en.go @@ -15,7 +15,7 @@ zcli login Alternatively, you can use the ZEROPS_TOKEN environment variable to authenticate: export ZEROPS_TOKEN="" -Note: The stored authentication data created by the login command takes precedence over the environment variable if both are present. +Note: The environment variable takes precedence over stored authentication data created by the login command, if both are present. Replace with the authentication token generated from your Zerops account.