untitaker / quickenv

An unintrusive environment manager
MIT License
184 stars 4 forks source link

Global commands sometimes don't run with envvars configured (auto-shimming insufficient) #5

Open untitaker opened 2 years ago

untitaker commented 2 years ago

If an envrc exports environment variables that do not add or shadow existing commands, but are rather meant to mutate behavior of existing global commands, quickenv will not export those environment variables correctly.

An example of this is sentry's crash-reporting. sentry installs sentry-cli globally (using its own installer), and then exports a SENTRY_DSN environment variable that configures sentry-cli to report crashes to a particular server:

curl ... | sh # install sentry-cli in global PATH
export SENTRY_DSN=...  # configure sentry-cli to report errors

Since sentry-cli is not exposed via a new PATH entry, quickenv will not shim it automatically, and as such sentry-cli will not run with SENTRY_DSN in its envvars.

There are multiple workarounds: