Useful for managing aliases and/or environments. Currently loading another mode once a mode is loaded only resets aliases. This can be used for managing aliases, PATH, misc global vars or whatever into seperate modes of operations or to organize projects.
Download modes.sh and "source" from whatever .profile or just use as .profile, .bash_profile etc..
git clone https://github.com/chalonga/modes.sh modes
cp modes/modes.sh .modes.sh
echo '. ${HOME}/.modes.sh' >> ${HOME}/.bash_profile
. modes.sh # or add to .bashrc or .bash_profile
cp .bash_profile .bash_profile.bak
conda init
mv .bash_profile ~/.modes/conda
mv .bash_profile.bak .bash_profile
mode conda
mode dev edit
Executes: editor ~/.modes/dev
mode dev
Executes: source ~/.modes/dev
mode dev show
Executes: cat file ~/.modes/dev
TODO
Help:
On demand source script loader
Usage : mode [modename] [action] [action argument]
List : mode
Load : mode <modename>
Show : mode <modename> show
Edit : mode <modename> edit
Import : mode <modename> import <othermode>
Help : mode help