Skip to content

Commit

Permalink
Workaround for home.dir property not being set (#2573)
Browse files Browse the repository at this point in the history
* Workaround for home.dir property not being set

* Add a TODO
  • Loading branch information
MaciejG604 authored Nov 28, 2023
1 parent 4dfdf69 commit f8b3367
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 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,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
Expand Down

0 comments on commit f8b3367

Please sign in to comment.