Created
July 26, 2012 23:20
-
-
Save spheromak/3185198 to your computer and use it in GitHub Desktop.
bashrc and simple aliases for managing multiple chef envs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Need to move your initial ~/.chef to ~/.chef-ENV | |
# | |
alias prod="rm ~/.chef; ln -sf ~/.chef-prod ~/.chef; export CHEF_ENV=prod" | |
alias dev="rm ~/.chef; ln -sf ~/.chef-dev ~/.chef; export CHEF_ENV=dev" | |
function knife_env { | |
if [ -e ~/.chef ] ; then | |
echo $( cd -P ~/.chef ; echo ${PWD##*-} ) | |
fi | |
} | |
# add your current env to the prompt | |
PS1="\u@\h \$(knife_env) $" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment