mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
55e36e10a7
I need it to be much closer to Android....
34 lines
638 B
Bash
Executable file
34 lines
638 B
Bash
Executable file
#!/bin/bash
|
|
set -u -e
|
|
|
|
FILES=""
|
|
ARGS=""
|
|
APP=./obj_linux_memdbg/xwords
|
|
|
|
usage() {
|
|
echo "usage: $0 [args...] file1.db [file2..n.db]"
|
|
echo "opens them with CrossWords, assuming they're dbs."
|
|
exit 0
|
|
}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
if [ '--help' == $1 ]; then
|
|
usage
|
|
elif [ -f $1 ]; then
|
|
if file -L $1 | grep -q 'SQLite 3.x database'; then
|
|
FILES="${FILES} $1"
|
|
else
|
|
ARGS="${ARGS} $1"
|
|
fi
|
|
else
|
|
ARGS="${ARGS} $1"
|
|
fi
|
|
shift
|
|
done
|
|
|
|
for FILE in $FILES; do
|
|
LOGFILE="${FILE/.db/_log.txt}"
|
|
echo >> $LOGFILE
|
|
echo "******************** launch by $0 ********************" >> $LOGFILE
|
|
exec ${APP} ${ARGS} --db $FILE 2>>$LOGFILE &
|
|
done
|