mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
fix to take defaults from current dir
This commit is contained in:
parent
6cf138b962
commit
f3b289f4be
1 changed files with 35 additions and 4 deletions
|
@ -1,16 +1,47 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
DIR=""
|
||||||
|
NODE=""
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
[ $# -gt 0 ] && echo "Error: $1"
|
[ $# -gt 0 ] && echo "Error: $1"
|
||||||
echo "usage: $0 <dir> <pkg-node> "
|
echo "usage: $0 [--dir <dir>] [--node <pkg-node>] "
|
||||||
echo " # e.g. XWords4 or XWords4-dbg and xw4 or xw4_dbg"
|
echo " # e.g. XWords4 or XWords4-dbg and xw4 or xw4_dbg"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $# -gt 1 ] || usage "dir and node parameters required"
|
while [ $# -gt 1 ]; do
|
||||||
|
case $1 in
|
||||||
|
--dir)
|
||||||
|
shift
|
||||||
|
DIR=$1
|
||||||
|
;;
|
||||||
|
--node)
|
||||||
|
shift
|
||||||
|
NODE=$1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$DIR" ]; then
|
||||||
|
if [ -f ./AndroidManifest.xml ]; then # we're in the right directory
|
||||||
|
DIR=$(basename $(pwd))
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -z "$NODE" ]; then
|
||||||
|
if [ -f ./AndroidManifest.xml ]; then # we're in the right directory
|
||||||
|
NODE=$(grep 'package="org.eehouse.android' AndroidManifest.xml | sed 's,^.*android.\(.*\)",\1,')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -n "$DIR" -a -n "$NODE" ] || usage
|
||||||
|
|
||||||
DIR=$1
|
|
||||||
NODE=$2
|
|
||||||
|
|
||||||
BASE=$(dirname $0)
|
BASE=$(dirname $0)
|
||||||
cd $BASE/../${DIR}/bin/classes
|
cd $BASE/../${DIR}/bin/classes
|
||||||
|
|
Loading…
Reference in a new issue