forked from github/server
fix the error in create-orders
This commit is contained in:
parent
a02c80cf76
commit
88f698df6e
|
@ -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
|
run-turn sendreports.sh
|
||||||
IGNORE=sendreport.sh create-orders
|
IGNORE=sendreport.sh
|
||||||
|
|
||||||
shellcheck: $(SCRIPTS)
|
shellcheck: $(SCRIPTS)
|
||||||
shellcheck $(SCRIPTS)
|
shellcheck $(SCRIPTS)
|
||||||
|
|
|
@ -3,26 +3,25 @@
|
||||||
GAME=$1
|
GAME=$1
|
||||||
TURN=$2
|
TURN=$2
|
||||||
|
|
||||||
if [ ! -d $ERESSEA/game-$GAME ] ; then
|
if [ ! -d "$ERESSEA/game-$GAME" ] ; then
|
||||||
echo "No such game: $GAME"
|
echo "No such game: $GAME"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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"
|
echo "orders.dir.$TURN already exists"
|
||||||
else
|
else
|
||||||
mv orders.dir orders.dir.$TURN
|
mv orders.dir "orders.dir.$TURN"
|
||||||
mkdir -p orders.dir
|
mkdir -p orders.dir
|
||||||
fi
|
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
|
lockfile -r3 -l120 orders.queue.lock
|
||||||
if [ -e orders.queue ] ; then
|
if [ -e orders.queue ] ; then
|
||||||
mv orders.queue orders.dir.$TURN/orders.queue
|
mv orders.queue "orders.dir.$TURN/orders.queue"
|
||||||
fi
|
fi
|
||||||
rm -f orders.queue.lock
|
rm -f orders.queue.lock
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue