forked from github/server
27 lines
431 B
Bash
Executable File
27 lines
431 B
Bash
Executable File
#!/bin/bash
|
|
|
|
GAME=$1
|
|
TURN=$2
|
|
|
|
if [ ! -d "$ERESSEA/game-$GAME" ] ; then
|
|
echo "No such game: $GAME"
|
|
exit 1
|
|
fi
|
|
|
|
cd "$ERESSEA/game-$GAME" || exit
|
|
|
|
if [ -d "orders.dir.$TURN" ]; then
|
|
echo "orders.dir.$TURN already exists"
|
|
exit
|
|
fi
|
|
rm -f "orders.$TURN"
|
|
|
|
cd orders.dir || exit
|
|
|
|
php ../../orders-php/cli.php -d "orders.db" export | tr -d '\r' > "../orders.$TURN"
|
|
|
|
cd .. || exit
|
|
mv orders.dir "orders.dir.$TURN"
|
|
mkdir -p orders.dir
|
|
|