fix the error in create-orders

This commit is contained in:
Enno Rehling 2017-12-03 17:30:41 +01:00
parent a02c80cf76
commit 88f698df6e
2 changed files with 8 additions and 9 deletions

View File

@ -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)

View File

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