Skip to content

Commit

Permalink
Workaround for home.dir property not being set
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejG604 committed Nov 27, 2023
1 parent 4dfdf69 commit 082b3ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/cli/src/main/scala/scala/cli/ScalaCli.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ import scala.util.Properties

object ScalaCli {

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
Expand Down

0 comments on commit 082b3ba

Please sign in to comment.