From 19dc8d1bfd2b4aa8eaf19ac2b7391191ec3681e6 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Sun, 25 Oct 2020 18:59:53 -0700 Subject: [PATCH] Replace spaces with %20 in path names If there are strings in the path name, the sbt-script argument will be interpreted as multiple arguments. The thin client also needs to be updated to handle %20 in path names. --- src/universal/bin/sbt | 4 +++- src/universal/bin/sbt.bat | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/universal/bin/sbt b/src/universal/bin/sbt index d0fac18cd..ae707bc7d 100755 --- a/src/universal/bin/sbt +++ b/src/universal/bin/sbt @@ -621,7 +621,9 @@ runNativeClient() { unset 'original_args[i]' fi done - execRunner "$sbtn_command" "--sbt-script=$0" "${original_args[@]}" + sbt_script=$0 + sbt_script=${sbt_script/ /%20} + execRunner "$sbtn_command" "--sbt-script=$sbt_script" "${original_args[@]}" } original_args=("$@") diff --git a/src/universal/bin/sbt.bat b/src/universal/bin/sbt.bat index a651eecb2..41ce56f87 100755 --- a/src/universal/bin/sbt.bat +++ b/src/universal/bin/sbt.bat @@ -646,7 +646,9 @@ if defined sbt_args_verbose ( if not "%~1" == "" ( call :echolist %* ) set "SBT_ARGS=-v !SBT_ARGS!" ) -set "SBT_ARGS=--sbt-script=!SBT_BIN_DIR!sbt.bat %SBT_ARGS%" + +set "SBT_SCRIPT=!SBT_BIN_DIR: =%%20!sbt.bat" +set "SBT_ARGS=--sbt-script=!SBT_SCRIPT! %SBT_ARGS%" rem Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) is required rem https://www.microsoft.com/en-us/download/details.aspx?id=13523