Skip to content

Commit 1c0f2f0

Browse files
committed
Support Boa nightly version
You can get nightly releases from https://github.com/boa-dev/boa/releases/tag/nightly This adds support for installing them with `esvu install boa@nightly`. The filenames are somewhat different.
1 parent 09a20f3 commit 1c0f2f0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/engines/boa.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ const { platform } = require('../common');
1010

1111
const binaryName = platform.startsWith('win') ? 'boa.exe' : 'boa';
1212

13-
function getFilename() {
13+
function getFilename(version) {
14+
const isNightly = version === 'nightly';
1415
switch (platform) {
1516
case 'darwin-x64':
16-
return 'boa-macos-amd64';
17+
return isNightly ? 'boa-x86_64-apple-darwin' : 'boa-macos-amd64';
1718
case 'linux-x64':
18-
return 'boa-linux-amd64';
19+
return isNightly ? 'boa-x86_64-unknown-linux-gnu' : 'boa-linux-amd64';
1920
case 'win32-x64':
20-
return 'boa-windows-amd64.exe';
21+
return isNightly ? 'boa-x86_64-pc-windows-msvc.exe' : 'boa-windows-amd64.exe';
22+
case 'darwin-arm64':
23+
if (isNightly) return 'boa-aarch64-apple-darwin';
24+
// fall through
2125
default:
2226
throw new Error(`No Boa builds available for ${platform}`);
2327
}
@@ -39,7 +43,7 @@ class BoaInstaller extends Installer {
3943
}
4044

4145
getDownloadURL(version) {
42-
return `https://github.com/boa-dev/boa/releases/download/${version}/${getFilename()}`;
46+
return `https://github.com/boa-dev/boa/releases/download/${version}/${getFilename(version)}`;
4347
}
4448

4549
async extract() {

0 commit comments

Comments
 (0)