4 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
7 if [ "${APP}" = "${APP%.app}" ]; then
8 echo "Could not find .app dir" >&2
12 # check to see if $1 is set and is not start of other cli set args
14 if [ -n "$ARG1" -a "$ARG1" = "${ARG1#-}" -a \! "$ARG1" = "open" ]; then
15 # first argument exists and does not start with a "-" and is not "open"
19 APPDIR="${APP}/Contents/Resources/app"
20 JAVA="${APPDIR}/jre/Contents/Home/bin/java"
21 GETDOWNTXT="${APPDIR}/getdown.txt"
22 # always check grep and sed regexes on macOS -- they're not the same
23 if [ -e "$GETDOWNTXT" ]; then
25 for x in $(grep -e 'code = ' "${GETDOWNTXT}" | sed -e 's/^code\s*=\s*//;'); do
26 [ -n "$CLASSPATH" ] && CLASSPATH="${CLASSPATH}:"
27 CLASSPATH="${CLASSPATH}${APPDIR}/${x}"
30 echo "Cannot find getdown.txt" >&2
34 "$JAVA" -cp "$CLASSPATH" jalview.bin.Launcher $OPEN "$@"