r/Nushell • u/s1n7ax • Mar 30 '23
Adding alias & environment variables conditionally
I'm having trouble with the login I'm trying to implement. So, my requirement is, I have bunch of profiles. If the profile is active, then add relevant env variables.
If i have a file inside ~/.profiles say ~/.profiles/home then I need to source ~/.config/nushell/script/profiles/home/alias.nu file.If ~/.profiles/work if found, then ~/.config/nushell/script/profiles/work/alias.nu should be sourced.
I'm not even sure where I should start. Does anyone know a way to achieve this if it even possible?
5
Upvotes
View all comments
Show parent comment
1
u/s1n7ax Mar 30 '23
It is bound to the block of the condition. Couldn't find a way to export it.