diff --git a/package.json b/package.json index 69274e0..640f383 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,14 @@ "license": "MPL-2.0", "homepage": "https://github.com/WebTools-NG/WebTools-NG", "private": true, - - "scripts": { + "scripts": { "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", + "build:win32": "script\\getGitVer.cmd && vue-cli-service electron:build", + "lint": "vue-cli-service lint", "electron:build": "vue-cli-service electron:build", "electron:serve": "vue-cli-service electron:serve", diff --git a/script/getGitVer.cmd b/script/getGitVer.cmd new file mode 100644 index 0000000..f52628f --- /dev/null +++ b/script/getGitVer.cmd @@ -0,0 +1,10 @@ +@echo off +: Export rev to env, for the artifact +FOR /F "tokens=*" %%g IN ('git rev-parse --short HEAD') do (SET AppRev=%%g) +: Get git root directory +FOR /F "tokens=*" %%h IN ('git rev-parse --show-toplevel') do (SET root=%%h) +: get commit hash for version file +set rev={"rev":"%AppRev%"} + +: Save to version file +echo %rev% > %root%/public/version.json \ No newline at end of file