Created
January 17, 2014 16:46
-
-
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
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
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