Skip to content

Instantly share code, notes, and snippets.

@calebhaye
Created February 27, 2014 19:55
Show Gist options
  • Select an option

  • Save calebhaye/9258126 to your computer and use it in GitHub Desktop.

Select an option

Save calebhaye/9258126 to your computer and use it in GitHub Desktop.

Revisions

  1. calebhaye created this gist Feb 27, 2014.
    13 changes: 13 additions & 0 deletions pre-push
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/bin/sh

    branch=`git rev-parse --abbrev-ref HEAD`
    echo "Running tests before pushing ...."
    if [ $branch == 'master' ]; then
    exit_code=$(bundle exec rake > /dev/null 2>/dev/null )$?
    if [ $exit_code -gt 0 ]
    then echo "Did not push because of failing tests"
    fi
    exit $exit_code
    fi

    exit 0