Skip to content

Commit e651036

Browse files
committed
Remove unused update helper functions
Remove getUpdateSystemName and getVersionSuffix from src/main.js. These helpers (platform name mapping and semver prerelease normalization) were unused/duplicative and have been deleted to simplify the update-related code. getPlatformPackageExtension and getAppUpdateUrl remain unchanged, so there should be no behavioral change to update URL construction.
1 parent 6cd6607 commit e651036

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

src/main.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -52,41 +52,13 @@ const APP_ICON_PATH = path.join(
5252
process.platform === "win32" ? "app.ico" : "app.png"
5353
);
5454

55-
function getUpdateSystemName() {
56-
if (process.platform === "win32") return "windows";
57-
if (process.platform === "darwin") return "macos";
58-
if (process.platform === "linux") return "linux";
59-
return process.platform;
60-
}
61-
6255
function getPlatformPackageExtension() {
6356
if (process.platform === "win32") return "exe";
6457
if (process.platform === "darwin") return "dmg";
6558
if (process.platform === "linux") return "AppImage";
6659
return "zip";
6760
}
6861

69-
function getVersionSuffix(version) {
70-
const raw = String(version || "").trim();
71-
const semverMatch = raw.match(/^\d+\.\d+\.\d+(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);
72-
const prerelease = semverMatch?.[1] || "";
73-
74-
if (!prerelease) {
75-
return "release";
76-
}
77-
78-
const normalized = prerelease.toLowerCase();
79-
if (normalized.startsWith("alpha")) return "alpha";
80-
if (normalized.startsWith("beta")) return "beta";
81-
if (normalized.startsWith("rc")) return "rc";
82-
if (normalized.startsWith("dev")) return "dev";
83-
if (normalized.startsWith("nightly")) return "nightly";
84-
if (normalized.startsWith("canary")) return "canary";
85-
86-
// Fallback to prerelease tag itself when it is a custom identifier.
87-
return normalized.replace(/[^a-z0-9.-]/g, "") || "preview";
88-
}
89-
9062
function getAppUpdateUrl() {
9163
const version = app.getVersion();
9264
const ext = getPlatformPackageExtension();

0 commit comments

Comments
 (0)