-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Some environment variables may start or end with a colon character (path entry delimiter). Such value has a special meaning (like falling back to the default paths for MANPATH).
It is desired to add colon character to such variable whether it is currently unset or already hold some path elements.
Adding delimiter character as path element currently raises an error on append-path and prepend-path. And if variable is unset, adding an empty string will not produce a path variable with a colon character.
At the moment, best solution to add a colon character to a path-like variable is following code:
if {[info exists env(VAR)]} {
append-path VAR :
} else {
setenv VAR :
}It would be interesting to be able to add colon character with one command whatever the state of the environment variable:
append-path VAR :Such feature is for instance wanted to generate simpler modulefile code on package manager tool like EasyBuild (easybuilders/easybuild-framework#4442).