From 88f698df6e0236a12190d9b0d17fa0ef01678418 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 3 Dec 2017 17:30:41 +0100 Subject: [PATCH] fix the error in create-orders --- process/Makefile | 4 ++-- process/create-orders | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) 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