-
Notifications
You must be signed in to change notification settings - Fork 347
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
env._.source
scripts should be able to modify the PATH
#3646
Comments
I believe you can but it may not be documented since this was something I needed for unrelated things in mise's internals I never intended to expose—except to possibly plugin devs. You can set There is logic in mise to diff 2 PATH variables so this could also work in the way you're expecting, but since I only needed this for internal logic it wasn't necessary at the time to put the diffing into _.source. I also kind of prefer _.source since if you do something crazy with PATH the diffing logic could fail or maybe even do something you definitely didn't want. 9/10 times though people just insert at the front though. Maybe more like 99/100. |
I just tried with |
alright thanks for checking, I think this should work the way you originally expected by modifying PATH directly |
* fix: trap panics in task resolving * feat: allow inserting PATH in env._.source Fixes jdx#3646
Describe the bug
A shell script sources by
env._.source
cannot modify the PATH environment variable.To Reproduce
In a new directory:
Create a
test.sh
file:and a .mise.toml:
Expected behavior
The
FOO_TEST
environment variable should be set and the change should be made to thePATH
environment variable but only the first happens.mise doctor
outputThe text was updated successfully, but these errors were encountered: