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

Commit 793919e

Browse files
committed
pass App arguments with spaces correctly to the java exec // fixes #57
1 parent 6d114f0 commit 793919e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/universalJavaApplicationStub

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# #
1212
# @author Tobias Fischer #
1313
# @url https://github.com/tofi86/universalJavaApplicationStub #
14-
# @date 2018-02-12 #
1514
# @version 2.1.0 #
15+
# @date 2018-02-17 #
1616
# #
1717
##################################################################################
1818
# #
@@ -716,9 +716,9 @@ export CFProcessPath="$0"
716716

717717
# remove Apples ProcessSerialNumber from passthru arguments (#39)
718718
if [[ $@ == -psn* ]] ; then
719-
ArgsPassthru=""
719+
ArgsPassthru=()
720720
else
721-
ArgsPassthru=$@
721+
ArgsPassthru=("$@")
722722
fi
723723

724724
# change to Working Directory based upon Apple/Oracle Plist info
@@ -735,7 +735,7 @@ stub_logger "[WorkingDirectory] ${WorkingDirectory}"
735735
# - main class
736736
# - main arguments
737737
# - passthru arguments
738-
stub_logger "[Exec] \"$JAVACMD\" -cp \"${JVMClassPath}\" -splash:\"${ResourcesFolder}/${JVMSplashFile}\" -Xdock:icon=\"${ResourcesFolder}/${CFBundleIconFile}\" -Xdock:name=\"${CFBundleName}\" ${JVMOptions:+$JVMOptions }${JVMDefaultOptions:+$JVMDefaultOptions }${JVMMainClass}${MainArgs:+ $MainArgs}${ArgsPassthru:+ $ArgsPassthru}"
738+
stub_logger "[Exec] \"$JAVACMD\" -cp \"${JVMClassPath}\" -splash:\"${ResourcesFolder}/${JVMSplashFile}\" -Xdock:icon=\"${ResourcesFolder}/${CFBundleIconFile}\" -Xdock:name=\"${CFBundleName}\" ${JVMOptions:+$JVMOptions }${JVMDefaultOptions:+$JVMDefaultOptions }${JVMMainClass}${MainArgs:+ $MainArgs}${ArgsPassthru:+ $(printf "'%s' " "${ArgsPassthru[@]}")}"
739739
exec "${JAVACMD}" \
740740
-cp "${JVMClassPath}" \
741741
-splash:"${ResourcesFolder}/${JVMSplashFile}" \
@@ -745,4 +745,4 @@ exec "${JAVACMD}" \
745745
${JVMDefaultOptions:+$JVMDefaultOptions }\
746746
${JVMMainClass}\
747747
${MainArgs:+ $MainArgs}\
748-
${ArgsPassthru:+ $ArgsPassthru}
748+
${ArgsPassthru:+ "${ArgsPassthru[@]}"}

0 commit comments

Comments
 (0)