poll a git repo and invoke make if something changed

This commit is contained in:
Peter J. Holzer 2022-10-22 22:40:46 +02:00
parent 548965d10e
commit 0da7f66aa6
1 changed files with 19 additions and 0 deletions

19
pull-and-make Executable file
View File

@ -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 "$@"