Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Fixes quotation in universal/bin/sbt #280

Merged
merged 1 commit into from
Sep 13, 2019

Conversation

kingslef
Copy link
Contributor

Fixes sbt/sbt#5076. Arrays should be enclosed in
quotes, or otherwise elements with spaces will be broken, e.g. -Dfoobar="foo bar" will become -Dfoobar=foo and bar.

Fixes sbt/sbt#5076. Arrays should be enclosed in
quotes, or otherwise elements with spaces will be broken, e.g. `-Dfoobar="foo
bar"` will become `-Dfoobar=foo` and `bar`.
@kingslef
Copy link
Contributor Author

Running sbt-1.3.0 with debugs enabled:

$ ~/Downloads/sbt-1.3.0/bin/sbt -Dfoo="bar foo" sbtVersion
[residual] arg = '-sbt-create'
[addJava] arg = '-Dfoo=bar foo'
[residual] arg = 'sbtVersion'
[residual] arg = 'sbtVersion'
[process_args] java_version = '8'
[sbt_options] declare -a sbt_options=()
[addMemory] arg = '1024'
[addJava] arg = '-Xms1024m'
[addJava] arg = '-Xmx1024m'
[addJava] arg = '-Xss4M'
[addJava] arg = '-XX:ReservedCodeCacheSize=128m'
# Executing command line:
java
-Dfile.encoding=UTF-8
-Dfoo=bar
foo
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-jar
~/Downloads/sbt-1.3.0/bin/sbt-launch.jar
sbtVersion

Error: Could not find or load main class foo

with the PR:

$ ~/Downloads/sbt-1.3.0/bin/sbt -Dfoo="foo bar" sbtVersion
[residual] arg = '-sbt-create'
[addJava] arg = '-Dfoo=foo bar'
[residual] arg = 'sbtVersion'
[residual] arg = 'sbtVersion'
[process_args] java_version = '8'
[sbt_options] declare -a sbt_options=()
[addMemory] arg = '1024'
[addJava] arg = '-Xms1024m'
[addJava] arg = '-Xmx1024m'
[addJava] arg = '-Xss4M'
[addJava] arg = '-XX:ReservedCodeCacheSize=128m'
# Executing command line:
java
-Dfile.encoding=UTF-8
"-Dfoo=foo bar"
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-jar
~/Downloads/sbt-1.3.0/bin/sbt-launch.jar
sbtVersion

[warn] No sbt.version set in project/build.properties, base directory: /private/var/fol
ders/px/6y9k7lzs1kv8g2kbfgflr_gcvmvs68/T/tmp.lhSRsyat                                 
[info] Loading settings for project global-plugins from idea.sbt,credentials.sbt,plugin
s.sbt,metals.sbt ...                                                                  
[info] Loading global plugins from ~/.sbt/1.0/plugins
^C

@er1c
Copy link
Contributor

er1c commented Sep 13, 2019

LGTM 👍 I thought I had already added quotes to these pesky things!

@eed3si9n
Copy link
Member

@er1c I am guessing it was me who removed the quotes then.

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kingslef!

@eed3si9n eed3si9n merged commit b24ec38 into sbt:master Sep 13, 2019
@eed3si9n eed3si9n changed the title universal/bin/sbt: enclose arrays in quotes Fixes quotation in universal/bin/sbt Sep 20, 2019
@eed3si9n eed3si9n mentioned this pull request Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.3.0] Can't use system properties with spaces anymore
3 participants