From 2afdfe7aee915a0956845a3604ca12c49752cf71 Mon Sep 17 00:00:00 2001 From: Tadas Dailyda Date: Tue, 13 Dec 2022 16:59:10 +0200 Subject: [PATCH] cli: darwin universal support in js-binding-template.ts --- cli/src/js-binding-template.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cli/src/js-binding-template.ts b/cli/src/js-binding-template.ts index 1aedb6b7..1d336c22 100644 --- a/cli/src/js-binding-template.ts +++ b/cli/src/js-binding-template.ts @@ -105,6 +105,15 @@ switch (platform) { } break case 'darwin': + localFileExisted = existsSync(join(__dirname, '${localName}.darwin-universal.node')) + try { + if (localFileExisted) { + nativeBinding = require('./${localName}.darwin-universal.node') + } else { + nativeBinding = require('${pkgName}-darwin-universal') + } + break + } catch {} switch (arch) { case 'x64': localFileExisted = existsSync(join(__dirname, '${localName}.darwin-x64.node'))