Created
August 29, 2013 13:59
-
-
Save debugwand/6378438 to your computer and use it in GitHub Desktop.
Running guard-jasmine from a git pre-commit hook with workaround for rvm problems
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
#!/bin/sh | |
# | |
#Run JS tests before commit | |
echo "LOCAL PRE-COMMIT HOOKS" | |
if [ -d "$HOME/.rvm/bin" ]; then | |
PATH="$HOME/.rvm/bin:$PATH" | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
if [ -f ".ruby-version" ]; then | |
rvm use "$(cat .ruby-version)" | |
fi | |
if [ -f ".ruby-gemset" ]; then | |
rvm gemset use "$(cat .ruby-gemset)" | |
fi | |
fi | |
ruby "bin/hooks/$(basename "$0").rb" | |
source "$HOME/.rvm/scripts/rvm" | |
rvm reload > /dev/null | |
guard-jasmine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment