Maintain CLI environments to work on different projets or clients.
You have to manage several environments (where environment is a set of environment variables). For example for clients or for different projects. Each project has it's own AWS keys, Chef/Puppet/Your-own-super-cool-tool-here settings, etc. You end up with a bunch of shell scripts that set up such environments. You wish they would be organized better but you never have the time to do that.
E provides lightweight framework in bash allowing some order and organization of such scripts. E also makes it easy to move the common parts of such scripts to one place, allowing better maintenance.
- Place the E binary somewhere in the path.
- Create the ~/.E directory.
Adding new environment
- Create a directory, named after the project name.
cdto that directory
.env.shfile (empty or with bunch of
export X=Ylines or more advanced stuff)
Activating an environment
E <env-name>- activates the given environment
whiptail-based menu: 5 most recently used environments at the top
===separator and then all the environments in alpabetical order.
Setup and work toaster
# E binary setup - start cd grep -qF ":$HOME/.bin" ~/.bashrc || echo "export PATH=$PATH:$HOME/.bin" >>~/.bashrc mkdir .bin wget -O .bin/E https://raw.github.com/ilyash/E/master/E . ~/.bashrc chmod +x .bin/E mkdir .E # E binary setup - done # Setting up "my-super-proj" project - start mkdir my-super-proj cd my-super-proj echo "export TEST=1" >.env.sh E add # ignore the error "grep: ..../.E/list: No such file or directory" # Setting up "my-super-proj" project - done # Work with an environment - start E # pick the project in the menu # output: *** Setting up environment 'my-super-proj' *** # when finished: CTRL+D # output: *** Exited environment 'my-super-proj' *** # Work with an environment - done
Suggested bashrc additions
if [ -f ~/.bin/E.completion ]; then . ~/.bin/E.completion fi alias cdd='cd $E_HOME'
![screenshot of "E" running without arguments](img/screenshot-select.png "screenshot of "E" running without arguments")