Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow path element equal to delimiter character on append/prepend-path #522

Closed
xdelaruelle opened this issue Jan 29, 2024 · 0 comments
Closed
Milestone

Comments

@xdelaruelle
Copy link
Member

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).

@xdelaruelle xdelaruelle added this to the 5.4.0 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant