Skip to content

Commit 11c56c4

Browse files
committed
Change default config directory for tests integration and docs-test modules to avoid overriding global user config
1 parent 864e1a5 commit 11c56c4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

build.sc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,14 @@ object `docs-tests` extends SbtModule with ScalaCliScalafixModule with HasTests
112112
Deps.osLib,
113113
Deps.pprint
114114
)
115-
115+
def tmpDirBase = T.persistent {
116+
PathRef(T.dest / "working-dir")
117+
}
116118
def extraEnv = T {
117-
Seq("SCLICHECK_SCALA_CLI" -> cli.standaloneLauncher().path.toString)
119+
Seq(
120+
"SCLICHECK_SCALA_CLI" -> cli.standaloneLauncher().path.toString,
121+
"SCALA_CLI_CONFIG" -> (tmpDirBase().path / "config" / "config.json").toString
122+
)
118123
}
119124
def forkEnv = super.forkEnv() ++ extraEnv()
120125

@@ -869,7 +874,8 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
869874
)
870875
def forkEnv = super.forkEnv() ++ Seq(
871876
"SCALA_CLI_TMP" -> tmpDirBase().path.toString,
872-
"SCALA_CLI_PRINT_STACK_TRACES" -> "1"
877+
"SCALA_CLI_PRINT_STACK_TRACES" -> "1",
878+
"SCALA_CLI_CONFIG" -> (tmpDirBase().path / "config" / "config.json").toString
873879
)
874880
private def updateRef(name: String, ref: PathRef): PathRef = {
875881
val rawPath = ref.path.toString.replace(

0 commit comments

Comments
 (0)