Skip to content

Commit f8b3367

Browse files
authored
Workaround for home.dir property not being set (#2573)
* Workaround for home.dir property not being set * Add a TODO
1 parent 4dfdf69 commit f8b3367

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/cli/src/main/scala/scala/cli/ScalaCli.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ import scala.util.Properties
2020

2121
object ScalaCli {
2222

23+
// TODO: Remove this part once fix is released in os-lib (Issue #2585)
24+
if (scala.util.Try(os.Path(System.getProperty("user.home"))).isFailure) {
25+
System.err.println("Warning: user.home property is not set, setting it to user.dir")
26+
System.setProperty("user.home", System.getProperty("user.dir"))
27+
}
28+
2329
if (Properties.isWin && isGraalvmNativeImage)
2430
// have to be initialized before running (new Argv0).get because Argv0SubstWindows uses csjniutils library
2531
// The DLL loaded by LoadWindowsLibrary is statically linke/d in

0 commit comments

Comments
 (0)