From ddeaf30f14c67b2f0dbe50f58a3daae6480ca27a Mon Sep 17 00:00:00 2001 From: Milton Moura Date: Tue, 16 Jan 2024 02:18:05 -0100 Subject: [PATCH] feat(cli): Add support for s390x linux arch in js bindings template (#1901) Signed-off-by: Milton Moura --- cli/src/api/templates/js-binding.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cli/src/api/templates/js-binding.ts b/cli/src/api/templates/js-binding.ts index 80e3f06f..95413c62 100644 --- a/cli/src/api/templates/js-binding.ts +++ b/cli/src/api/templates/js-binding.ts @@ -303,6 +303,20 @@ switch (platform) { } } break + case 's390x': + localFileExisted = existsSync( + join(__dirname, '${localName}.linux-s390x-gnu.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./${localName}.linux-s390x-gnu.node') + } else { + nativeBinding = require('${pkgName}-linux-s390x-gnu') + } + } catch (e) { + loadError = e + } + break default: throw new Error(\`Unsupported architecture on Linux: \${arch}\`) }