-
-
Save millisami/3186686 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 | |
# gls on osx/homebrew assumes you have installed gnu fileutils. change to ls on linux | |
echo `gls -dl --indicator-style=none ~/.chef | awk -F- '{print $5}'` | |
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