version fix

This commit is contained in:
Alex Holliday committed 2025-06-25 11:56:04 +08:00
1 parent 8606b5e5de
commit b03f951352
4 files changed
+26 -7

No files matched your search

+8 -7
View File
@@ -5,13 +5,14 @@ import { execSync } from "child_process";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
let version;
try {
version =
env.VITE_APP_VERSION ||
execSync("git describe --tags --abbrev=0").toString().trim();
} catch (error) {
version = "unknown";
let version = env.VITE_APP_VERSION;
if (!version) {
try {
version = execSync("git describe --tags --abbrev=0").toString().trim();
} catch {
version = "unknown";
}
}
return {