Skip to content

Commit 76a78dd

Browse files
fix broken build script
1 parent 484eb9e commit 76a78dd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/scripts/libmongocrypt.mjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import util from 'node:util';
44
import process from 'node:process';
5-
import fs from 'node:fs/promises';
5+
import fs, { readFile } from 'node:fs/promises';
66
import child_process from 'node:child_process';
77
import events from 'node:events';
88
import path from 'node:path';
@@ -189,9 +189,17 @@ async function buildBindings(args, pkg) {
189189
await run('npm', ['run', 'prepare']);
190190

191191
if (process.platform === 'darwin' && process.arch === 'arm64') {
192+
// @ts-ignore
193+
const {
194+
binary: {
195+
napi_versions: [
196+
napiVersion
197+
]
198+
}
199+
} = JSON.parse(await readFile(resolveRoot('package.json'), 'utf-8'));
192200
// The "arm64" build is actually a universal binary
193-
const armTar = `mongodb-client-encryption-v${pkg.version}-napi-v4-darwin-arm64.tar.gz`;
194-
const x64Tar = `mongodb-client-encryption-v${pkg.version}-napi-v4-darwin-x64.tar.gz`;
201+
const armTar = `mongodb-client-encryption-v${pkg.version}-napi-v${napiVersion}-darwin-arm64.tar.gz`;
202+
const x64Tar = `mongodb-client-encryption-v${pkg.version}-napi-v${napiVersion}-darwin-x64.tar.gz`;
195203
await fs.copyFile(resolveRoot('prebuilds', armTar), resolveRoot('prebuilds', x64Tar));
196204
}
197205
}

0 commit comments

Comments
 (0)