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

Commit 3cda6fb

Browse files
author
spectre683
committed
Add support for arrays of VMOptions in Apple style Info.plists
Apple style Info.plist files can have strings or arrays for the VMOptions key - add support for arrays.
1 parent 76222cd commit 3cda6fb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/universalJavaApplicationStub

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,13 @@ if [ $exitcode -eq 0 ]; then
180180
# expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOME
181181
JVMClassPath=`eval "echo ${JVMClassPath}"`
182182

183-
# read the JVM Default Options
184-
JVMDefaultOptions=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:VMOptions" "${InfoPlistFile}" 2> /dev/null | xargs`
183+
# read the JVM Default Options in either Array or String style
184+
JVMDefaultOptions_RAW=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:VMOptions" "${InfoPlistFile}" 2> /dev/null | xargs`
185+
if [[ $JVMDefaultOptions_RAW == *Array* ]] ; then
186+
JVMDefaultOptions=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:VMOptions" "${InfoPlistFile}" 2> /dev/null | grep " " | sed 's/^ */ /g' | tr -d '\n' | xargs`
187+
else
188+
JVMDefaultOptions=${JVMDefaultOptions_RAW}
189+
fi
185190

186191
# read the JVM Arguments
187192
JVMArguments=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:Arguments" "${InfoPlistFile}" 2> /dev/null | xargs`

0 commit comments

Comments
 (0)