Last active
August 29, 2015 14:22
-
-
Save ndelage/2c1d8cd9b7b0d0cbd795 to your computer and use it in GitHub Desktop.
recently modified rspec files
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/bash | |
# Find modified specs between HEAD and some other point in the | |
# commit history. Defaults to comparing between master & HEAD. | |
# | |
# Supply an optional alternative point in history as the first & only | |
# argument: | |
# recent_specs.sh HEAD~8 | |
# | |
# | |
# Easily run specs with xargs: | |
# recent_specs.sh | xargs spring rspec | |
if [ -z "$1" ]; then | |
BRANCH='master' | |
else | |
BRANCH=$1 | |
fi | |
git diff --name-only $BRANCH HEAD | grep "^spec" | uniq | while read F; do | |
if [ -f "$F" ] | |
then | |
echo $F | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment