Skip to content

Commit

Permalink
Add env for configuring home directory overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejG604 committed Nov 28, 2023
1 parent 9014c2a commit 324e005
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/cli/src/main/scala/scala/cli/ScalaCli.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ 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"))
val homeDirOverride = Option(System.getenv("SCALA_CLI_HOME_DIR_OVERRIDE"))
.getOrElse(System.getProperty("user.dir"))
System.setProperty("user.home", homeDirOverride)
}

if (Properties.isWin && isGraalvmNativeImage)
Expand Down

0 comments on commit 324e005

Please sign in to comment.