#184 set Windows title on Linux/Darwin

This commit is contained in:
UKDTOM 2020-10-17 00:40:27 +02:00
parent 4c6f843b8a
commit f3e727574a
5 changed files with 19 additions and 10 deletions

2
.gitignore vendored
View file

@ -24,4 +24,4 @@ yarn-error.log*
/dist_electron*
#WebTools-NG speclials
/public/version
/public/version.json

View file

@ -7,7 +7,9 @@
"homepage": "https://github.com/WebTools-NG/WebTools-NG",
"private": true,
"scripts": {
"serve": "vue-cli-service electron:serve",
"serve": "run-script-os",
"serve:darwin:linux": "chmod +x script/getGitVer.sh && . script/getGitVer.sh && vue-cli-service electron:serve && unset AppRev",
"serve:win32": "vue-cli-service electron:serve",
"build": "run-script-os",
"build:darwin:linux": "chmod +x script/getGitVer.sh && . script/getGitVer.sh && vue-cli-service electron:build && unset AppRev",
"build:win32": "vue-cli-service electron:build",

View file

@ -1,9 +1,8 @@
# get commit hash
rev=$(git rev-parse --short HEAD 2>&1)
# Export to env as well, for the artifact
echo $(git rev-parse --short HEAD)
# Export rev to env, for the artifact
export AppRev=$(git rev-parse --short HEAD)
# Get git root directory
root=$(git rev-parse --show-toplevel 2>&1)
# get commit hash for version file
rev='{"rev":"'$(git rev-parse --short HEAD 2>&1)'"}'
# Save to version file
echo "$rev" > "$root/public/version"
echo "$rev" > "$root/public/version.json"

View file

@ -46,6 +46,14 @@ function createWindow () {
win.on('closed', () => {
win = null
})
// Set proper title for main window
win.webContents.on('did-finish-load', () => {
let rev = require('../public/version.json').rev;
let windowtitle = appName + " v" + process.env.VUE_APP_VERSION + "." + rev;
win.setTitle(windowtitle);
})
}
// Quit when all windows are closed.

View file

@ -18,8 +18,8 @@ module.exports = {
"to": "locales"
},
{
"from": "./public/version",
"to": "version"
"from": "./public/version.json",
"to": "version.json"
}
],
linux: {