HenrikBengtsson / startup

:wrench: R package: startup - Friendly R Startup Configuration
https://henrikbengtsson.github.io/startup/
160 stars 5 forks source link

WISH: File tag for testing whether an env var is set or not #89

Open HenrikBengtsson opened 4 years ago

HenrikBengtsson commented 4 years ago

It is possible to do:

but it is neither possible to test for empty value nor non-defined values; the following doesn't work:

HenrikBengtsson commented 1 year ago

This would allow us to test for NO_COLOR, and other environment variables whose values do not matter. What matters is only whether or not the environment variable is defined (non-empty).

In order to move forward on this, we need a syntax for testing whether or not an environment variable is nuset (or empty). It could be !NO_COLOR to check when not set, but to check when set, we can't just use NO_COLOR, because that's ambigous. Maybe !!NO_COLOR?