Skip to content

Commit

Permalink
chore: Show visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aisrael committed Mar 29, 2024
1 parent 58cf44a commit 8c844d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -25,6 +24,7 @@ $ doppler --version
```

To update:

```sh
$ brew upgrade doppler
```
Expand Down
11 changes: 6 additions & 5 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 @@ -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)
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
10 changes: 0 additions & 10 deletions tests/e2e/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 8c844d3

Please sign in to comment.