Skip to content

Commit

Permalink
Enforce settings load order
Browse files Browse the repository at this point in the history
  • Loading branch information
bjuric committed Nov 5, 2024
1 parent 83a2644 commit 4c8855f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/scala/gwen/core/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ object Settings extends LazyLogging {

private val resolver = new Interpolator(name => getOpt(name)).settings

private val userProjectSettingsFiles: List[File] = {
val userSettingsFile: Option[File] = FileIO.userDir.flatMap(d => settingsFileInDir(d, "gwen"))
val projectSettingsFile: Option[File] = settingsFileInDir(new File("."), "gwen")
userSettingsFile.toList ++ projectSettingsFile.toList
}
private val userSettingsFiles: List[File] = FileIO.userDir.flatMap(d => settingsFileInDir(d, "gwen")).toList
private val projectSettingsFiles: List[File] = settingsFileInDir(new File("."), "gwen").toList

init()

Expand Down Expand Up @@ -88,7 +85,8 @@ object Settings extends LazyLogging {

configProps = new Properties()
val orphans = new Properties()
val sFiles = (settingsFiles.foldLeft(userProjectSettingsFiles) { FileIO.appendFile }).reverse
//val sFiles = (settingsFiles.foldLeft(userProjectSettingsFiles) { FileIO.appendFile }).reverse
val sFiles = (settingsFiles.foldLeft(userSettingsFiles) { FileIO.appendFile }) ++ projectSettingsFiles
config = sFiles filter(!_.exists) match {
case Nil =>
(
Expand Down

0 comments on commit 4c8855f

Please sign in to comment.