mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
add commandline option to spec log dir location
This commit is contained in:
parent
d05a67ed4b
commit
81df91c4db
1 changed files with 9 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -u -e
|
set -u -e
|
||||||
|
|
||||||
LOGDIR=$(basename $0)_logs
|
LOGDIR=./$(basename $0)_logs
|
||||||
APP_NEW=""
|
APP_NEW=""
|
||||||
DO_CLEAN=""
|
DO_CLEAN=""
|
||||||
APP_NEW_PARAMS=""
|
APP_NEW_PARAMS=""
|
||||||
|
@ -598,6 +598,7 @@ function getArg() {
|
||||||
function usage() {
|
function usage() {
|
||||||
[ $# -gt 0 ] && echo "Error: $1" >&2
|
[ $# -gt 0 ] && echo "Error: $1" >&2
|
||||||
echo "Usage: $(basename $0) \\" >&2
|
echo "Usage: $(basename $0) \\" >&2
|
||||||
|
echo " [--log-root] # default: . \\" >&2
|
||||||
echo " [--dup-packets] # send all packets twice \\" >&2
|
echo " [--dup-packets] # send all packets twice \\" >&2
|
||||||
echo " [--clean-start] \\" >&2
|
echo " [--clean-start] \\" >&2
|
||||||
echo " [--game-dict <path/to/dict>]* \\" >&2
|
echo " [--game-dict <path/to/dict>]* \\" >&2
|
||||||
|
@ -653,6 +654,11 @@ while [ "$#" -gt 0 ]; do
|
||||||
APPS_OLD[${#APPS_OLD[@]}]=$(getArg $*)
|
APPS_OLD[${#APPS_OLD[@]}]=$(getArg $*)
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--log-root)
|
||||||
|
[ -d $2 ] || usage "$1: no such directory $2"
|
||||||
|
LOGDIR=$2/$(basename $0)_logs
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--dup-packets)
|
--dup-packets)
|
||||||
DUP_PACKETS=1
|
DUP_PACKETS=1
|
||||||
;;
|
;;
|
||||||
|
@ -761,7 +767,8 @@ for FILE in $(ls $LOGDIR/*.{xwg,txt} 2>/dev/null); do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$RESUME" -a -d $LOGDIR ]; then
|
if [ -z "$RESUME" -a -d $LOGDIR ]; then
|
||||||
mv $LOGDIR /tmp/${LOGDIR}_$$
|
NEWNAME="$(basename $LOGDIR)_$$"
|
||||||
|
(cd $(dirname $LOGDIR) && mv $(basename $LOGDIR) /tmp/${NEWNAME})
|
||||||
fi
|
fi
|
||||||
mkdir -p $LOGDIR
|
mkdir -p $LOGDIR
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue