make_scmrev.h.js: set default auto-update track from environment

This commit is contained in:
Pierre Bourdon 2018-01-03 18:32:42 -08:00
parent 0427d3474c
commit 5498f9b7ef

View file

@ -81,6 +81,8 @@ var isStable = +("master" == branch || "stable" == branch);
// Get environment information.
var distributor = wshShell.ExpandEnvironmentStrings("%DOLPHIN_DISTRIBUTOR%");
if (distributor == "%DOLPHIN_DISTRIBUTOR%") distributor = "None";
var default_update_track = wshShell.ExpandEnvironmentStrings("%DOLPHIN_DEFAULT_UPDATE_TRACK%");
if (default_update_track == "%DOLPHIN_DEFAULT_UPDATE_TRACK%") default_update_track = "";
// remove hash (and trailing "-0" if needed) from description
describe = describe.replace(/(-0)?-[^-]+(-dirty)?$/, '$2');
@ -90,7 +92,8 @@ var out_contents =
"#define SCM_DESC_STR \"" + describe + "\"\n" +
"#define SCM_BRANCH_STR \"" + branch + "\"\n" +
"#define SCM_IS_MASTER " + isStable + "\n" +
"#define SCM_DISTRIBUTOR_STR \"" + distributor + "\"\n";
"#define SCM_DISTRIBUTOR_STR \"" + distributor + "\"\n" +
"#define SCM_UPDATE_TRACK_STR \"" + default_update_track + "\"\n";
// check if file needs updating
if (out_contents == GetFileContents(outfile))