Fix the macOS download link 404ing

publicDownloadUrl built the disk image URL from manifest.version, but the
version carries a build suffix the release tag does not: version
"1.0.0-alpha.3.app.59" lives under tag "1.0.0-alpha.3". Every macOS
visitor was handed a 404.

Derive it from the updater URL instead, rewriting only the filename so
the tag comes from the release directory the manifest points at.
This commit is contained in:
Chris Tsang
2026-08-26 23:56:52 +01:00
parent 2a87d8cf82
commit 1adde15f42
+10 -12
View File
@@ -414,20 +414,18 @@
return ''; return '';
} }
function publicDownloadUrl(manifest, platform, updaterUrl) { function publicDownloadUrl(platform, updaterUrl) {
if (platform.label !== 'macOS') { if (platform.label !== 'macOS' || !updaterUrl) {
return updaterUrl; return updaterUrl;
} }
if (manifest.version) { // The manifest points at Tauri's updater bundle; a person wants the
return 'https://github.com/visioncortex/vtracer/releases/download/' + // disk image sitting beside it. Rewrite only the filename, so the
manifest.version + // release tag comes from the URL we were handed: manifest.version
'/VTracer_' + // carries a build suffix the tag does not, and building the URL from
manifest.version + // it 404s (version '1.0.0-alpha.3.app.59' lives under tag
'_universal.dmg'; // '1.0.0-alpha.3').
} return updaterUrl.replace(/\.app\.tar\.gz$/i, '.dmg');
return updaterUrl.replace(/_universal\.app\.tar\.gz$/i, '_universal.dmg');
} }
var platform = detectPlatform(); var platform = detectPlatform();
@@ -459,7 +457,7 @@
}) })
.then(function(manifest) { .then(function(manifest) {
var updaterUrl = findPlatformDownload(manifest.platforms || {}, platform); var updaterUrl = findPlatformDownload(manifest.platforms || {}, platform);
var downloadUrl = publicDownloadUrl(manifest, platform, updaterUrl); var downloadUrl = publicDownloadUrl(platform, updaterUrl);
if (!downloadUrl) { if (!downloadUrl) {
return; return;