Skip to content

Commit

Permalink
Do not output cloud login token to stdout when --quiet is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- committed Mar 16, 2022
1 parent e8db80d commit c0bd688
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/login_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ This will set the default token used when just "k6 run -o cloud" is passed.`,

if newCloudConf.Token.Valid {
valueColor := getColor(globalState.flags.noColor || !globalState.stdOut.isTTY, color.FgCyan)
printToStdout(globalState, fmt.Sprintf(" token: %s\n", valueColor.Sprint(newCloudConf.Token.String)))
if !globalState.flags.quiet {
printToStdout(globalState, fmt.Sprintf(" token: %s\n", valueColor.Sprint(newCloudConf.Token.String)))
}
printToStdout(globalState, fmt.Sprintf(
"Logged in successfully, token saved in %s\n", globalState.flags.configFilePath,
))
}
return nil
},
Expand Down

0 comments on commit c0bd688

Please sign in to comment.