From c45615f0a028cc373788e47a58f9b7aea03f0b63 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 28 May 2019 10:30:26 -0700 Subject: [PATCH] Add changelog, undo null tolerance. Null tolerance is a plague. I wish `String` did not admit nulls and we had to use Optional for potentially null strings, but Java will forever be cursed with the billion dollar mistake. --- CHANGELOG.md | 2 ++ .../java/com/threerings/getdown/data/Application.java | 9 +++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e2a029..238df75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ * Fixed issues with proxy information not getting properly passed through to app. Via [#216](//github.com/threerings/getdown/pull/216). +* `appbase` and `latest` properties in `getdown.txt` now process env var subtitutions. + ## 1.8.4 - May 14, 2019 * Added `verify_timeout` config to allow customization of the default (60 second) timeout during diff --git a/core/src/main/java/com/threerings/getdown/data/Application.java b/core/src/main/java/com/threerings/getdown/data/Application.java index fa132f9..c0125e5 100644 --- a/core/src/main/java/com/threerings/getdown/data/Application.java +++ b/core/src/main/java/com/threerings/getdown/data/Application.java @@ -586,7 +586,7 @@ public class Application throw new RuntimeException("m.missing_appbase"); } - // check if we're overriding the domain in the appbase + // check if we're overriding the domain in the appbase, and sub envvars _appbase = processArg(SysProps.overrideAppbase(_appbase)); // make sure there's a trailing slash @@ -606,8 +606,9 @@ public class Application } // check for a latest config URL - String latest = processArg(config.getString("latest")); + String latest = config.getString("latest"); if (latest != null) { + latest = processArg(latest); if (latest.startsWith(_appbase)) { latest = _appbase + latest.substring(_appbase.length()); } else { @@ -1121,10 +1122,6 @@ public class Application /** Replaces the application directory and version in any argument. */ protected String processArg (String arg) { - if (arg == null) { - return null; - } - arg = arg.replace("%APPDIR%", getAppDir().getAbsolutePath()); arg = arg.replace("%VERSION%", String.valueOf(_version));