Skip to content

Commit 95d828a

Browse files
authored
Remove the macOS universal installer (#257)
* Remove macOS universal installer * Update `_freeze`
1 parent e178e17 commit 95d828a

File tree

5 files changed

+56
-9
lines changed

5 files changed

+56
-9
lines changed

_download.html

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
transition-duration: 1s;
1616
}
1717

18+
.hidden {
19+
display: none !important;
20+
}
21+
22+
#macos-buttons {
23+
display: flex;
24+
gap: 0.5rem;
25+
flex-wrap: wrap;
26+
}
27+
1828
.checksum {
1929
cursor: pointer;
2030
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
@@ -84,8 +94,26 @@
8494
downloadUrl = `${cdnUrl}win/x86_64/Positron-${version}-UserSetup-x64.exe`;
8595
allDownloadsText = 'System Installer & Other Platforms';
8696
} else if (userAgent.indexOf('Mac') !== -1) {
97+
// Show two buttons for macOS: Apple Silicon and Intel
98+
const macButtons = document.getElementById('macos-buttons');
99+
const macArmBtn = document.getElementById('download-btn-mac-arm');
100+
const macIntelBtn = document.getElementById('download-btn-mac-intel');
101+
102+
if (macButtons && macArmBtn && macIntelBtn) {
103+
// Hide the main download button, show the macOS buttons
104+
downloadBtn.style.display = 'none';
105+
macButtons.classList.remove('hidden');
106+
107+
// Set download URLs for both buttons
108+
const armUrl = `${cdnUrl}mac/arm64/Positron-${version}-arm64.dmg`;
109+
const intelUrl = `${cdnUrl}mac/x64/Positron-${version}-x64.dmg`;
110+
macArmBtn.dataset.originalHref = armUrl;
111+
macArmBtn.href = armUrl;
112+
macIntelBtn.dataset.originalHref = intelUrl;
113+
macIntelBtn.href = intelUrl;
114+
}
115+
87116
detectedOS = 'for macOS';
88-
downloadUrl = `${cdnUrl}mac/universal/Positron-${version}-universal.dmg`;
89117
allDownloadsText = 'Other Platforms';
90118
} else if (userAgent.indexOf('Linux') !== -1) {
91119
detectedOS = 'for Linux';
@@ -119,6 +147,8 @@
119147
const downloadTable = window.document.querySelector("#download-table");
120148
const downloadLinks = window.document.querySelectorAll("#download-table a");
121149
const downloadBtn = window.document.getElementById("download-btn");
150+
const macArmBtn = window.document.getElementById("download-btn-mac-arm");
151+
const macIntelBtn = window.document.getElementById("download-btn-mac-intel");
122152

123153
if (enable) {
124154
if (downloadTable) {
@@ -129,6 +159,14 @@
129159
downloadBtn.disabled = false;
130160
downloadBtn.classList.remove("disabled");
131161
}
162+
if (macArmBtn) {
163+
macArmBtn.disabled = false;
164+
macArmBtn.classList.remove("disabled");
165+
}
166+
if (macIntelBtn) {
167+
macIntelBtn.disabled = false;
168+
macIntelBtn.classList.remove("disabled");
169+
}
132170
}
133171
else {
134172
if (downloadTable) {
@@ -139,6 +177,14 @@
139177
downloadBtn.disabled = true;
140178
downloadBtn.classList.add("disabled");
141179
}
180+
if (macArmBtn) {
181+
macArmBtn.disabled = true;
182+
macArmBtn.classList.add("disabled");
183+
}
184+
if (macIntelBtn) {
185+
macIntelBtn.disabled = true;
186+
macIntelBtn.classList.add("disabled");
187+
}
142188
}
143189

144190
downloadLinks.forEach((link) => {

0 commit comments

Comments
 (0)