diff --git a/admin/automerge b/admin/automerge index 218ecb067c7..6182ad01a55 100755 --- a/admin/automerge +++ b/admin/automerge @@ -28,6 +28,11 @@ ## Intended usage: ## Have a dedicated git directory just for this. ## Have a cron job that calls this script with -r -p. +## +## Modifying a running shell script can have unpredictable results, +## so the paranoid will first make a copy of this script, and then run +## it with the -d option to point to the repository directory, in case +## a pull updates this script while it is working. die () # write error to stderr and exit { @@ -40,20 +45,14 @@ PD=${0%/*} [ "$PD" = "$0" ] && PD=. # if PATH includes PWD -## This should be the admin directory. -cd $PD -cd ../ -[ -d admin ] || die "Could not locate admin directory" - -[ -e .git ] || die "No .git" - usage () { cat 1>&2 < /dev/null