Skip to content

Instantly share code, notes, and snippets.

@mikemackintosh
Created January 17, 2014 16:46
Show Gist options
  • Save mikemackintosh/8476734 to your computer and use it in GitHub Desktop.
Save mikemackintosh/8476734 to your computer and use it in GitHub Desktop.
bash tool to auto pull current branch when entering a directory and set your rock runtime if you have a .rock.yml file
env_mgr() {
if [ "$PWD" != "$OLDPWD" ]; then
OLDPWD="$PWD";
if [ -d .git ]; then
git pull
if [ -e ".rock.yml" ]; then
ROCK_RUNTIME=$(cat .rock.yml |grep runtime |cut -d" " -f2)
eval $(rock --runtime=${ROCK_RUNTIME} env)
fi
}
export PROMPT_COMMAND=env_mgr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment