Skip to content

Instantly share code, notes, and snippets.

@spheromak
Created July 26, 2012 23:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spheromak/3185198 to your computer and use it in GitHub Desktop.
Save spheromak/3185198 to your computer and use it in GitHub Desktop.
bashrc and simple aliases for managing multiple chef envs
#
# 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