Skip to content

Commit

Permalink
add sanity check for correct cookie syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
memo33 committed Jul 7, 2024
1 parent ee06637 commit 370cfd6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/scala/sc4pac/Constants.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ object Constants {
* For details, see the instructions in `sc4pac.bat`.
*/
lazy val simtropolisCookie: Option[String] = Option(System.getenv("SC4PAC_SIMTROPOLIS_COOKIE")).filter(_.nonEmpty)
.map { s =>
if (s.startsWith("\"") || s.endsWith("\"")) {
System.err.println("Warning: SC4PAC_SIMTROPOLIS_COOKIE should not be surrounded by quotes. Remove the quotes and try again.")
}
s
}

/* On non-Windows platforms, cicdec is invoked by `mono cicdec [args]`, but on Windows Mono is not required: `cicdec [args]`.
* We choose reasonable defaults, but allow customizing these two commands via environment variables (which are set in the launch scripts).
Expand Down

0 comments on commit 370cfd6

Please sign in to comment.