mirror of
https://github.com/LucasDower/ObjToSchematic.git
synced 2024-11-27 02:19:58 +08:00
Added version to window title bar
This commit is contained in:
parent
9bd13ccb1d
commit
eaa47e7d92
@ -3,7 +3,6 @@
|
||||
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>ObjToSchematic – Convert 3D models into Minecraft builds</title>
|
||||
<link rel="stylesheet" href="./styles.css">
|
||||
</head>
|
||||
|
||||
|
@ -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",
|
||||
|
12
src/main.ts
12
src/main.ts
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user