Skip to content

Instantly share code, notes, and snippets.

@millisami
Forked from spheromak/bash_profile.sh
Created July 27, 2012 07:41
Show Gist options
  • Save millisami/3186686 to your computer and use it in GitHub Desktop.
Save millisami/3186686 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
# 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