mirror of
https://github.com/titaniumnetwork-dev/Ultraviolet.git
synced 2025-05-13 03:50:01 -04:00
include build number in error screen
This commit is contained in:
parent
b78de17402
commit
aa3a176afb
2 changed files with 18 additions and 1 deletions
14
build.js
14
build.js
|
@ -1,6 +1,7 @@
|
|||
import { rimraf } from 'rimraf';
|
||||
import { copyFile, mkdir, readFile, writeFile } from 'node:fs/promises';
|
||||
import { build } from 'esbuild';
|
||||
import { execSync } from "node:child_process";
|
||||
|
||||
// read version from package.json
|
||||
const pkg = JSON.parse(await readFile('package.json'));
|
||||
|
@ -29,6 +30,19 @@ let builder = await build({
|
|||
'process.env.ULTRAVIOLET_VERSION': JSON.stringify(
|
||||
process.env.ULTRAVIOLET_VERSION
|
||||
),
|
||||
'process.env.ULTRAVIOLET_COMMIT_HASH': (() => {
|
||||
try {
|
||||
let hash = JSON.stringify(
|
||||
execSync("git rev-parse --short HEAD", {
|
||||
encoding: "utf-8",
|
||||
}).replace(/\r?\n|\r/g, "")
|
||||
);
|
||||
|
||||
return hash;
|
||||
} catch (e) {
|
||||
return "unknown";
|
||||
}
|
||||
})(),
|
||||
},
|
||||
bundle: true,
|
||||
treeShaking: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue