Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application.conf values in production #65

Open
ASchmidt84 opened this issue Sep 9, 2022 · 1 comment
Open

application.conf values in production #65

ASchmidt84 opened this issue Sep 9, 2022 · 1 comment

Comments

@ASchmidt84
Copy link

Hello Tom

I encountered a problem. I have a default application.conf in my dev.

I have a argument for an dedicated conf file with the correct build date and number set up by my installer.
The conf is loaded and ready. After loading the conf I start the application. Buf sapphire always take the default conf.
How can I change this?
I can see the result in the

title. Because this is always (even conf loaded right) my dev title.

my main method

  override def main(args: Array[String]): Unit = {
    import scopt.OParser
    val builder = OParser.builder[ApplicationParameters]
    val parser1 = {
      import builder._
      OParser.sequence(
        programName("Panakeia"),
        head("panakeia cli","1.x.y"),
        opt[java.io.File]('c',"config")
          .required()
          .action( (file,param) => param.copy(config = Some(file) ) )
          .text("gives the config path")
      )
    }
    OParser.parse(parser1,args,ApplicationParameters()) match {
      case Some(r) if r.config.isDefined =>
        ServerController(r.config.get)
      case _ => //ServerController()
        throw new RuntimeException("Configuration file not set!")
    }
    SFXApplicationEnvironment.setApplication(this)
    javafx.application.Application.launch(classOf[SFXJavaApplication], args: _*)
  }
@ASchmidt84
Copy link
Author

I think the problem is in com.sfxcode.sapphire.data.Configuration
val config: Config = ConfigFactory.load()
This loads the conf even their is another one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant