Skip to content

Commit

Permalink
Show visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aisrael committed Mar 28, 2024
1 parent 58cf44a commit 7c90811
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/cmd/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
canPromptUser := !utils.GetBoolFlag(cmd, "no-interactive")
localConfig := configuration.LocalConfig(cmd)
visibility := cmd.Flag("visibility").Value.String()
visibilityModified := visibility != ""

utils.RequireValue("token", localConfig.Token.Value)

Expand Down Expand Up @@ -314,7 +315,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
Name: key,
Value: &value,
}
if visibility != "" {
if visibilityModified {
changeRequest.Visibility = &visibility
}
changeRequests = append(changeRequests, changeRequest)
Expand All @@ -327,7 +328,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
Name: key,
Value: &value,
}
if visibility != "" {
if visibilityModified {
changeRequest.Visibility = &visibility
}
changeRequests = append(changeRequests, changeRequest)
Expand All @@ -347,7 +348,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
} else {
changeRequest.Value = &secretArr[1]
}
if visibility != "" {
if visibilityModified {
changeRequest.Visibility = &visibility
}
changeRequests = append(changeRequests, changeRequest)
Expand All @@ -360,7 +361,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
}

if !utils.Silent {
printer.Secrets(response, keys, jsonFlag, false, raw, false, false)
printer.Secrets(response, keys, jsonFlag, false, raw, false, visibilityModified)
}
}

Expand Down

0 comments on commit 7c90811

Please sign in to comment.