The script allows to customise the env
per folder.
Just drop a file named .envrc
into a folder and add there your variables.
The script will automatically source the file when entering the folder and revert to the old env
when exiting
git clone https://github.com/ganglio/envdir.git ~/.envdir
echo "source ~/.envdir/envdir" >> .zshrc
pushs
Pushes $1 to the stackpops
Pops from stack. If $1 is provided the head of the stack is assigned to the $1 echoed otherwisegets
Get the ${1}th element from the stack without changing the stacksizes
Returns the size of the stackhas_envrc
Checks if the provided folder is enved. If no folder is provided checks the current folderpipeset
Assigns stdin to $1flushenv
Flushes the envpushenv
Pushes the env on the stackpopenv
Pops the env from the stack
The source code is hosted on GitHub. It's pretty simple and easy to understand.
Please feel free to submit pull requests and file bugs on the issue tracker.