Closed tkrajca closed 8 years ago
Hi @tkrajca Thank you for this contribution. However I'm inclined to consider this feature goes out of scope of what envdir
is entitled to serve.
We do not wish to go beyond what the reference implementation is providing.
I hope you understand.
Hi @ticosax, thanks for your reply, I do understand, no worries, I will probably create a new project envshellfile and use envdir as a dependency. Cheers.
@tkrajca Check out https://github.com/direnv/direnv and similar tools (e.g. https://github.com/Tarrasch/zsh-autoenv), which might be easier to get what you want.
You can use snippets like the following with zsh-autoenv:
for i in $envdir/*~*.*(.); do
eval "autostash ${i:t}='$(<$i)'"
done
This autostashes (exports and reverts when moving away) a list of envdir style files.
Regarding your example at hand, you could just source vars.sh
?!
( source vars.sh; env_command )
I am closing this pull request for now.
Thanks for providing it though, of course!
Say you have a shell script vars.sh with:
export tomas=krajca export envdir=isnice
envshellfile vars.sh env would run env command with environment variables from vars.sh
Happy to do some polishing :)