mirror of
https://github.com/OpenFusionProject/Client.git
synced 2025-09-27 13:20:06 +00:00
Get version number from package.json on app start
This is easy to miss when prepping a new release so I figured we might as well automate it
This commit is contained in:
@@ -54,7 +54,7 @@ body {
|
||||
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
}
|
||||
|
||||
#of-versionnumber {
|
||||
#of-versionnumberdiv {
|
||||
position: fixed;
|
||||
bottom: 4px;
|
||||
right: 8px;
|
||||
|
@@ -25,6 +25,23 @@ function disableServerListButtons() {
|
||||
$("#of-deleteserver-button").prop("disabled", true);
|
||||
}
|
||||
|
||||
function getAppVersion() {
|
||||
appversion = remote.require("app").getVersion();
|
||||
|
||||
// simplify version, ex. 1.4.0 -> 1.4,
|
||||
// but only if a revision number isn't present
|
||||
if(appversion.endsWith(".0")){
|
||||
return appversion.substr(0, appversion.length - 2)
|
||||
} else {
|
||||
return appversion
|
||||
}
|
||||
}
|
||||
|
||||
function setAppVersionText() {
|
||||
$("#of-aboutversionnumber").text("Version " + getAppVersion());
|
||||
$("#of-versionnumber").text("v" + getAppVersion());
|
||||
}
|
||||
|
||||
function addServer() {
|
||||
var jsontomodify = JSON.parse(
|
||||
remotefs.readFileSync(userdir + "\\servers.json")
|
||||
|
Reference in New Issue
Block a user