Added version to window title bar

This commit is contained in:
Lucas Dower 2022-03-31 20:37:02 +01:00
parent 9bd13ccb1d
commit eaa47e7d92
3 changed files with 12 additions and 5 deletions

View File

@ -3,7 +3,6 @@
<head>
<meta charset="utf8">
<title>ObjToSchematic Convert 3D models into Minecraft builds</title>
<link rel="stylesheet" href="./styles.css">
</head>

View File

@ -1,6 +1,6 @@
{
"name": "objtoschematic",
"version": "0.4.0",
"version": "0.5.0",
"description": "A tool to convert .obj files into voxels and then into Minecraft Schematic files",
"main": "./dist/src/main.js",
"engines": {
@ -16,7 +16,7 @@
"atlas": "node ./dist/tools/build-atlas.js",
"palette": "node ./dist/tools/build-palette.js",
"headless": "node ./dist/tools/headless.js",
"export": "electron-packager . ObjToSchematic --platform=win32 --arch=x64"
"package:win64": "electron-packager . ObjToSchematic --platform=win32 --arch=x64 --app-version=0.5.0"
},
"repository": {
"type": "git",

View File

@ -43,8 +43,7 @@ function createWindow() {
},
});
// mainWindow.removeMenu();
// Load index.html
mainWindow.loadURL(url.format({
pathname: path.join(BASE_DIR, './index.html'),
@ -52,6 +51,15 @@ function createWindow() {
slashes: true,
}));
const baseTitle = 'ObjToSchematic Convert 3D models into Minecraft builds';
try {
const branchName = require('child_process').execSync('git rev-parse --abbrev-ref HEAD');
const commitHash = require('child_process').execSync('git rev-parse --short HEAD');
mainWindow.setTitle(`${baseTitle} (git//${branchName}++${commitHash})`);
} catch (e: any) {
mainWindow.setTitle(`${baseTitle} (release//v0.5.0)`);
}
// Open the DevTools.
// mainWindow.webContents.openDevTools();