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

Commit 6aae09f

Browse files
committed
Support Array style Java:Arguments for Apple Plist style // fixes #76
1 parent a7ee3e4 commit 6aae09f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/universalJavaApplicationStub

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# #
1212
# @author Tobias Fischer #
1313
# @url https://github.com/tofi86/universalJavaApplicationStub #
14-
# @date 2018-08-24 #
14+
# @date 2019-12-08 #
1515
# @version 3.0.4 #
1616
# #
1717
##################################################################################
@@ -220,9 +220,14 @@ if [ $exitcode -eq 0 ]; then
220220
JVMDefaultOptions+=" -XstartOnFirstThread"
221221
fi
222222

223-
# read the JVM Arguments as an array and retain spaces
223+
# read the JVM Arguments in either Array or String style (#76) and retain spaces
224224
IFS=$'\t\n'
225-
MainArgs=($(xargs -n1 <<<$(plist_get_java ':Arguments')))
225+
MainArgs_RAW=$(plist_get_java ':Arguments' | xargs)
226+
if [[ $MainArgs_RAW == *Array* ]] ; then
227+
MainArgs=($(xargs -n1 <<<$(plist_get_java ':Arguments' | tr -d '\n' | sed -E 's/Array \{ *(.*) *\}/\1/g' | sed 's/ */ /g')))
228+
else
229+
MainArgs=($(xargs -n1 <<<$(plist_get_java ':Arguments')))
230+
fi
226231
unset IFS
227232
# post processing of the array follows further below...
228233

0 commit comments

Comments
 (0)