fix: update tauri.conf.json version to use full version information including build metadata
This commit is contained in:
@@ -169,19 +169,21 @@ async function updateTauriConfigVersion(newVersion) {
|
|||||||
const versionWithoutV = newVersion.startsWith("v")
|
const versionWithoutV = newVersion.startsWith("v")
|
||||||
? newVersion.slice(1)
|
? newVersion.slice(1)
|
||||||
: newVersion;
|
: newVersion;
|
||||||
const baseVersion = getBaseVersion(versionWithoutV);
|
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
"[INFO]: Current tauri.conf.json version is: ",
|
"[INFO]: Current tauri.conf.json version is: ",
|
||||||
tauriConfig.version,
|
tauriConfig.version,
|
||||||
);
|
);
|
||||||
tauriConfig.version = baseVersion;
|
|
||||||
|
// 使用完整版本信息,包含build metadata
|
||||||
|
tauriConfig.version = versionWithoutV;
|
||||||
|
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
tauriConfigPath,
|
tauriConfigPath,
|
||||||
JSON.stringify(tauriConfig, null, 2),
|
JSON.stringify(tauriConfig, null, 2),
|
||||||
"utf8",
|
"utf8",
|
||||||
);
|
);
|
||||||
console.log(`[INFO]: tauri.conf.json version updated to: ${baseVersion}`);
|
console.log(`[INFO]: tauri.conf.json version updated to: ${versionWithoutV}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error updating tauri.conf.json version:", error);
|
console.error("Error updating tauri.conf.json version:", error);
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Reference in New Issue
Block a user