Skip to content

Commit de29c47

Browse files
committed
feat: add arm64 support on osx
1 parent 6f9e87d commit de29c47

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
os: [ubuntu-latest, macos-13]
13+
os: [ubuntu-latest, macos-13, macos-14]
1414

1515
runs-on: ${{ matrix.os }}
1616

dist/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,9 +2886,13 @@ try {
28862886
break;
28872887
}
28882888
case 'darwin': {
2889-
let url = `${base_url}/FoundationDB-${version}_x86_64.pkg`;
2889+
let arch = os.arch();
2890+
let arch_suffix = arch === 'arm64' ? 'arm64' : 'x86_64';
2891+
let url = `${base_url}/FoundationDB-${version}_${arch_suffix}.pkg`;
2892+
let pkg_name = `FoundationDB-${version}_${arch_suffix}.pkg`;
2893+
28902894
exec(`curl -L -O ${url}`);
2891-
exec(`sudo installer -pkg FoundationDB-${version}_x86_64.pkg -target /`);
2895+
exec(`sudo installer -pkg ${pkg_name} -target /`);
28922896
break;
28932897
}
28942898
default:

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ try {
2525
break;
2626
}
2727
case 'darwin': {
28-
let url = `${base_url}/FoundationDB-${version}_x86_64.pkg`;
28+
let arch = os.arch();
29+
let arch_suffix = arch === 'arm64' ? 'arm64' : 'x86_64';
30+
let url = `${base_url}/FoundationDB-${version}_${arch_suffix}.pkg`;
31+
let pkg_name = `FoundationDB-${version}_${arch_suffix}.pkg`;
32+
2933
exec(`curl -L -O ${url}`);
30-
exec(`sudo installer -pkg FoundationDB-${version}_x86_64.pkg -target /`);
34+
exec(`sudo installer -pkg ${pkg_name} -target /`);
3135
break;
3236
}
3337
default:

0 commit comments

Comments
 (0)