diff --git a/process/Makefile b/process/Makefile index 194c9dd19..8edfed0b8 100644 --- a/process/Makefile +++ b/process/Makefile @@ -1,6 +1,6 @@ -SCRIPTS=compress.sh send-bz2-report send-zip-report \ +SCRIPTS=compress.sh send-bz2-report send-zip-report create-orders \ run-turn sendreports.sh -IGNORE=sendreport.sh create-orders +IGNORE=sendreport.sh shellcheck: $(SCRIPTS) shellcheck $(SCRIPTS) diff --git a/process/create-orders b/process/create-orders index b0ca292f4..7016741ac 100755 --- a/process/create-orders +++ b/process/create-orders @@ -3,26 +3,25 @@ GAME=$1 TURN=$2 -if [ ! -d $ERESSEA/game-$GAME ] ; then +if [ ! -d "$ERESSEA/game-$GAME" ] ; then echo "No such game: $GAME" exit 1 fi -cd $ERESSEA/game-$GAME +cd "$ERESSEA/game-$GAME" || exit -if [ -d orders.dir.$TURN ]; then +if [ -d "orders.dir.$TURN" ]; then echo "orders.dir.$TURN already exists" else - mv orders.dir orders.dir.$TURN + mv orders.dir "orders.dir.$TURN" mkdir -p orders.dir fi -ls -1rt orders.dir.$TURN/turn-* | xargs cat > orders.$TURN +ls -1rt "orders.dir.$TURN/turn-*" | xargs cat > "orders.$TURN" lockfile -r3 -l120 orders.queue.lock if [ -e orders.queue ] ; then - mv orders.queue orders.dir.$TURN/orders.queue + mv orders.queue "orders.dir.$TURN/orders.queue" fi rm -f orders.queue.lock -fi