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

Commit 7715c47

Browse files
authored
Merge pull request #25 from spectre683/patch-1
Add support for arrays of VMOptions in Apple style Info.plists
2 parents 841d568 + 3cda6fb commit 7715c47

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
@@ -177,8 +177,13 @@ if [ $exitcode -eq 0 ]; then
177177
# expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOME
178178
JVMClassPath=`eval "echo ${JVMClassPath}"`
179179

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

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

0 commit comments

Comments
 (0)