From 0380b6eb76429bb2b9395e4afaa17775343c4f35 Mon Sep 17 00:00:00 2001 From: Garrett Robinson Date: Wed, 19 Feb 2014 11:33:01 -0800 Subject: [PATCH] pre-push hook to run tests Adds a note on how to use Git hooks to the README. --- README.md | 11 ++++++++++- hooks/pre-push | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 hooks/pre-push diff --git a/README.md b/README.md index 9efc59b..7f0d924 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,13 @@ Privacy Badger for Firefox 1. Install addon-sdk [github](https://github.com/mozilla/addon-sdk) 2. [Addon-sdk documentation] (https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Installation) -2. cfx run +3. cfx run + +Contributing +============ + +Git hooks +--------- + +Are in `hooks/`. You can use them by copying the files to `.git/hooks`. The +pre-push hook will run the unit tests, and cancel the push if they fail. diff --git a/hooks/pre-push b/hooks/pre-push new file mode 100755 index 0000000..72d2578 --- /dev/null +++ b/hooks/pre-push @@ -0,0 +1,12 @@ +#!/bin/bash + +# Pre-push hook. If you want to test with a different version of firefox, put +# the path in the CFX_FIREFOX environment variable. + +cmd='cfx test' +if [ -n "$CFX_FIREFOX" ]; +then + cmd="$cmd -b $CFX_FIREFOX" +fi +echo $cmd +$cmd