From 89a04e968faff53d2e66ec70e7dce594e594f43e Mon Sep 17 00:00:00 2001 From: Chip Reed Date: Wed, 22 Feb 2023 21:32:23 -0800 Subject: [PATCH] update napi generated index.js --- tooling/cli/node/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tooling/cli/node/index.js b/tooling/cli/node/index.js index 389a626a7..5207fdcc3 100644 --- a/tooling/cli/node/index.js +++ b/tooling/cli/node/index.js @@ -15,7 +15,8 @@ function isMusl() { // For Node 10 if (!process.report || typeof process.report.getReport !== 'function') { try { - return readFileSync('/usr/bin/ldd', 'utf8').includes('musl') + const lddPath = require('child_process').execSync('which ldd').toString().trim(); + return readFileSync(lddPath, 'utf8').includes('musl') } catch (e) { return true } @@ -105,6 +106,15 @@ switch (platform) { } break case 'darwin': + localFileExisted = existsSync(join(__dirname, 'cli.darwin-universal.node')) + try { + if (localFileExisted) { + nativeBinding = require('./cli.darwin-universal.node') + } else { + nativeBinding = require('@tauri-apps/cli-darwin-universal') + } + break + } catch {} switch (arch) { case 'x64': localFileExisted = existsSync(join(__dirname, 'cli.darwin-x64.node'))