diff --git a/modules/cli/src/main/scala/scala/cli/ScalaCli.scala b/modules/cli/src/main/scala/scala/cli/ScalaCli.scala index b3b4f63fbe..27b626d494 100644 --- a/modules/cli/src/main/scala/scala/cli/ScalaCli.scala +++ b/modules/cli/src/main/scala/scala/cli/ScalaCli.scala @@ -20,6 +20,12 @@ import scala.util.Properties object ScalaCli { + // TODO: Remove this part once fix is released in os-lib (Issue #2585) + if (scala.util.Try(os.Path(System.getProperty("user.home"))).isFailure) { + System.err.println("Warning: user.home property is not set, setting it to user.dir") + System.setProperty("user.home", System.getProperty("user.dir")) + } + if (Properties.isWin && isGraalvmNativeImage) // have to be initialized before running (new Argv0).get because Argv0SubstWindows uses csjniutils library // The DLL loaded by LoadWindowsLibrary is statically linke/d in