diff --git a/pull-and-make b/pull-and-make new file mode 100755 index 0000000..39b7265 --- /dev/null +++ b/pull-and-make @@ -0,0 +1,19 @@ +#!/bin/sh +# +# Usage: pull-and-make directory [make-params] +# +# This script is intended to continually poll a git repo +# It will chdir to its first argument and pull from the remote repo +# If there is a new version it will invoke make with the rest of the +# arguments +set -x +set -e +cd "$1" +shift +git pull > ~/tmp/pull-and-make.$$ +if grep '^Already up to date.$' ~/tmp/pull-and-make.$$ +then + exit 1 +fi + +make "$@"