Skip to content

Instantly share code, notes, and snippets.

@stujo
Created May 13, 2015 23:06
Show Gist options
  • Save stujo/1e296c6c94334ce1c4fb to your computer and use it in GitHub Desktop.
Save stujo/1e296c6c94334ce1c4fb to your computer and use it in GitHub Desktop.
Script to Clone a Pull Request
#!/bin/sh
#YOU NEED TO DO THIS FIRST...
# mkdir sf-fiery-skippers-2015
# cd sf-fiery-skippers-2015/
# git clone git@github.com:sf-fiery-skippers-2015/phase-1-assessment.git
# cd phase-1-assessment/
if [ -z "$1" ] || [ -z "$2" ] ; then
echo "usage: fa1pr PULL_REQUEST_ID GITHUB_STUDENT_USERNAME"
echo "eg: fa1pr 12 stujo"
else
echo "Pull Request = $1, Branch Name = $2"
echo "Fetching pull/$1/head to $2"
git fetch origin pull/$1/head:$2
echo "Switching to $2 branch"
git checkout $2
echo "Opening Sublime"
subl .
echo "Running RSpecs"
cd part-1/
echo "PART 1 RSPEC" > ../rspec_results.txt
rspec >> ../rspec_results.txt
cd ../part-2/
echo "PART 2 RSPEC" >> ../rspec_results.txt
rspec >> ../rspec_results.txt
cd ../part-3/
echo "PART 3 RSPEC" >> ../rspec_results.txt
rspec >> ../rspec_results.txt
cd ..
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment