Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 5fa886b

Browse files
committed
code formatting
1 parent 1e9c287 commit 5fa886b

1 file changed

Lines changed: 28 additions & 31 deletions

File tree

src/universalJavaApplicationStub

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,20 @@
4747

4848

4949
#
50-
# resolve symlinks
50+
# set the directory abspath of the current
51+
# shell script with symlinks being resolved
5152
############################################
5253

5354
PRG=$0
54-
5555
while [ -h "$PRG" ]; do
56-
ls=`ls -ld "$PRG"`
57-
link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
58-
if expr "$link" : '^/' 2> /dev/null >/dev/null; then
59-
PRG="$link"
60-
else
61-
PRG="`dirname "$PRG"`/$link"
62-
fi
56+
ls=`ls -ld "$PRG"`
57+
link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
58+
if expr "$link" : '^/' 2> /dev/null >/dev/null; then
59+
PRG="$link"
60+
else
61+
PRG="`dirname "$PRG"`/$link"
62+
fi
6363
done
64-
65-
# set the directory abspath of the current shell script
6664
PROGDIR=`dirname "$PRG"`
6765

6866

@@ -390,15 +388,15 @@ oracle_jre_version=$(extractJavaMajorVersion $(extractJavaVersionString "${oracl
390388
# first check system variable "$JAVA_HOME"
391389
if [ -n "$JAVA_HOME" ] ; then
392390

393-
# PR 26: Allow specifying "$JAVA_HOME" relative to "$AppPackageFolder"
394-
# which allows for bundling a custom version of Java inside your app!
395-
if [[ $JAVA_HOME == /* ]] ; then
396-
# if "$JAVA_HOME" starts with a Slash it's an absolute path
397-
JAVACMD="$JAVA_HOME/bin/java"
398-
else
399-
# otherwise it's a relative path to "$AppPackageFolder"
400-
JAVACMD="$AppPackageFolder/$JAVA_HOME/bin/java"
401-
fi
391+
# PR 26: Allow specifying "$JAVA_HOME" relative to "$AppPackageFolder"
392+
# which allows for bundling a custom version of Java inside your app!
393+
if [[ $JAVA_HOME == /* ]] ; then
394+
# if "$JAVA_HOME" starts with a Slash it's an absolute path
395+
JAVACMD="$JAVA_HOME/bin/java"
396+
else
397+
# otherwise it's a relative path to "$AppPackageFolder"
398+
JAVACMD="$AppPackageFolder/$JAVA_HOME/bin/java"
399+
fi
402400

403401
# check for a specific Java version, specified in JVMversion Plist key
404402
elif [ ! -z ${JVMVersion} ] ; then
@@ -436,7 +434,7 @@ elif [ ! -z ${JVMVersion} ] ; then
436434
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA}${java_version_hr}.\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\"} default button \"${MSG_VISIT_JAVA_DOT_COM}\" with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)" \
437435
-e "set response to button returned of the result" \
438436
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"http://java.com\""
439-
# exit with error
437+
# exit with error
440438
exit 3
441439
fi
442440

@@ -504,14 +502,15 @@ elif [ -f "${JAVACMD}" ] && [ -x "${JAVACMD}" ] ; then
504502
cd "${WorkingDirectory}"
505503

506504
# execute Java and set
507-
# - classpath
508-
# - dock icon
509-
# - application name
510-
# - JVM options
511-
# - JVM default options
512-
# - main class
513-
# - main arguments
514-
# - passthru arguments
505+
# - classpath
506+
# - splash image
507+
# - dock icon
508+
# - app name
509+
# - JVM options
510+
# - JVM default options
511+
# - main class
512+
# - main arguments
513+
# - passthru arguments
515514
exec "${JAVACMD}" \
516515
-cp "${JVMClassPath}" \
517516
-splash:"${ResourcesFolder}/${JVMSplashFile}" \
@@ -525,12 +524,10 @@ elif [ -f "${JAVACMD}" ] && [ -x "${JAVACMD}" ] ; then
525524

526525

527526
else
528-
529527
# display error message with applescript
530528
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\"} default button \"${MSG_VISIT_JAVA_DOT_COM}\" with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)" \
531529
-e "set response to button returned of the result" \
532530
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"http://java.com\""
533-
534531
# exit with error
535532
exit 1
536533
fi

0 commit comments

Comments
 (0)