diff --git a/README.md b/README.md index f8ea62b5..70be753e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ The Doppler CLI is the official tool for interacting with your Doppler secrets a - Execute applications with your secrets injected into the environment - View activity and audit logs - ## Install The Doppler CLI is available in several popular package managers. It can also be installed via [shell script](https://github.com/DopplerHQ/cli/blob/master/INSTALL.md#shell-script), [GitHub Action](https://github.com/DopplerHQ/cli-action), or downloaded as a [standalone binary](https://github.com/DopplerHQ/cli/releases/latest). @@ -25,6 +24,7 @@ $ doppler --version ``` To update: + ```sh $ brew upgrade doppler ``` diff --git a/pkg/cmd/secrets.go b/pkg/cmd/secrets.go index 342fa8c2..9df433dd 100644 --- a/pkg/cmd/secrets.go +++ b/pkg/cmd/secrets.go @@ -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) @@ -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) @@ -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) @@ -343,11 +344,11 @@ func setSecrets(cmd *cobra.Command, args []string) { } if len(secretArr) < 2 { - changeRequest.Value = nil + changeRequest.Value = nil // don't change existing value } else { changeRequest.Value = &secretArr[1] } - if visibility != "" { + if visibilityModified { changeRequest.Visibility = &visibility } changeRequests = append(changeRequests, changeRequest) @@ -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) } } diff --git a/tests/e2e/update.sh b/tests/e2e/update.sh index ef04a3a3..ac9c8d36 100755 --- a/tests/e2e/update.sh +++ b/tests/e2e/update.sh @@ -45,16 +45,6 @@ output="$("$DOPPLER_BINARY" update --force 2>&1 || true)"; beforeEach -### gnupg perms issue -# make gnupg directory inaccessible -sudo chown root ~/.gnupg; -output="$("$DOPPLER_BINARY" update --force 2>&1 || true)"; -[ "$(echo "$output" | tail -1)" == "Doppler Error: exit status 4" ] || error "ERROR: expected update to fail without access to gnupg" -# restore gnupg directory perms -sudo chown "$(id -un)" ~/.gnupg; - -beforeEach - ### successful update sudo "$DOPPLER_BINARY" update --force >/dev/null 2>&1 || error "ERROR: unable to update CLI"