mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-04-27 22:49:39 +08:00
🧑💻 调整Sentry数据
This commit is contained in:
@@ -18,18 +18,8 @@ const pkgVersion = pkgJson.version;
|
||||
// 获取提交哈希
|
||||
const commitHash = execSync("git rev-parse --short HEAD").toString().trim();
|
||||
|
||||
// 获取当前平台
|
||||
let platform = "unknown";
|
||||
if (process.platform === "win32") {
|
||||
platform = "windows";
|
||||
} else if (process.platform === "darwin") {
|
||||
platform = process.arch === "arm64" ? "macos-arm" : "macos-intel";
|
||||
} else {
|
||||
platform = `${process.platform}-${process.arch}`;
|
||||
}
|
||||
|
||||
// 构建 Release 字符串
|
||||
const release = `TeyvatGuide@${pkgVersion}_dev_${commitHash}_${platform}`;
|
||||
const release = `TeyvatGuide@${pkgVersion}`;
|
||||
console.log(`🍄 gen sentry dev release ${release}`);
|
||||
|
||||
// 修改 .env.development.local
|
||||
@@ -39,6 +29,8 @@ if (!existsSync(envPath)) {
|
||||
} else {
|
||||
const envRead = parse(readFileSync(envPath, "utf-8"));
|
||||
envRead.VITE_SENTRY_RELEASE = release;
|
||||
envRead.VITE_COMMIT_HASH = commitHash;
|
||||
envRead.VITE_BUILD_TIME = Math.floor(Date.now() / 1000).toString();
|
||||
writeFileSync(envPath, stringify(envRead), "utf-8");
|
||||
}
|
||||
console.log("✅ .env.development.local updated!");
|
||||
|
||||
Reference in New Issue
Block a user