Skip to content

Commit 1a06983

Browse files
committed
fix: ZEROPS_TOKEN environment variable takes precedence over stored zcli
login data
1 parent 1f9cc15 commit 1a06983

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/cmdBuilder/createRunFunc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ func createCmdRunFunc(
8888
storedData := cliStorage.Data()
8989

9090
token := storedData.Token
91-
if token == "" {
92-
token = os.Getenv(constants.CliTokenEnvVar)
91+
if envToken, ok := os.LookupEnv(constants.CliTokenEnvVar); ok {
92+
token = envToken
9393
}
9494
if token == "" {
9595
if cmd.guestRunFunc != nil {

src/i18n/en.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ zcli login <your_token>
1515
Alternatively, you can use the ZEROPS_TOKEN environment variable to authenticate:
1616
export ZEROPS_TOKEN="<your_token>"
1717
18-
Note: The stored authentication data created by the login command takes precedence over the environment variable if both are present.
18+
Note: The environment variable takes precedence over stored authentication data created by the login command, if both are present.
1919
2020
Replace <your_token> with the authentication token generated from your Zerops account.
2121

0 commit comments

Comments
 (0)