Skip to content

Commit 230a078

Browse files
bishaboshaKordyjan
authored andcommitted
properly convert path of repo to uri
[Cherry-picked f31d750]
1 parent b3d9aee commit 230a078

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

dist/bin/scala.bat

+21-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,28 @@ goto end
3232

3333
:setScalaOpts
3434

35+
@REM sfind the index of the first colon in _PROG_HOME
36+
set "index=0"
37+
set "char=!_PROG_HOME:~%index%,1!"
38+
:findColon
39+
if not "%char%"==":" (
40+
set /a "index+=1"
41+
set "char=!_PROG_HOME:~%index%,1!"
42+
goto :findColon
43+
)
44+
45+
@REM set _PROG_HOME to the substring from the first colon to the end
46+
set "_PROG_HOME_SUB=!_PROG_HOME:~%index%!"
47+
@REM strip initial character
48+
set "_PROG_HOME_SUB=!_PROG_HOME_SUB:~1!"
49+
50+
@REM set drive to substring from 0 to the first colon
51+
set "_PROG_HOME_DRIVE=!_PROG_HOME:~0,%index%!"
52+
53+
54+
3555
set "_SCALA_VERSION="
36-
set "MVN_REPOSITORY=file://%_PROG_HOME:\=/%/maven2"
56+
set "MVN_REPOSITORY=file://%_PROG_HOME_DRIVE%\%_PROG_HOME_SUB:\=/%/maven2"
3757
set "SCALA_CLI_JAR=%_PROG_HOME%\etc\scala-cli.jar"
3858

3959
@rem read for version:=_SCALA_VERSION in VERSION_FILE

0 commit comments

Comments
 (0)