DopplerHQ / cli

The official CLI for interacting with your Doppler secrets and configuration.
https://docs.doppler.com
Apache License 2.0
226 stars 44 forks source link

Skip creating config dir when installing shell completions #198

Closed Piccirello closed 3 years ago

Piccirello commented 3 years ago

The completion install command is called by our install.sh script, which is often run with sudo. If the effective user differs from the real user, the config directory will be created with the wrong permissions, resulting in an error on all subsequent CLI runs.

To reproduce:

$ id
uid=1000(user)
$ sudo id
uid=0(root)
$ ls -ld /Users/user/.doppler
ls: /Users/user/.doppler: No such file or directory
$ sudo ./scripts/install.sh
Installed Doppler CLI v3.23.2
$ ls -ld /Users/user/.doppler
drwx------  3 root  staff  96 Apr 13 18:05 /Users/user/.doppler
# ^ directory is owned by 'root' rather than by 'user'

Closes DPLR-2014.