From 842c70047c228f1235361982333520b371b38f4a Mon Sep 17 00:00:00 2001 From: Pete Feltham Date: Thu, 13 Feb 2025 15:20:23 +1100 Subject: [PATCH] Look for arm64 binaries in _arm64 dirs --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 056c7a2..0b3805c 100644 --- a/index.js +++ b/index.js @@ -53,11 +53,11 @@ function generateBMFont (fontPath, opt, callback) { opt = {}; } - const lookupKey = process.arch === "arm64" ?`${process.platform}_${process.arch}` : process.platform; + const platformKey = process.arch === "arm64" ?`${process.platform}_${process.arch}` : process.platform; - const binName = binaryLookup[lookupKey]; + const binName = binaryLookup[platformKey]; - assert.ok(binName, `No msdfgen binary for platform ${lookupKey}.`); + assert.ok(binName, `No msdfgen binary for platform ${platformKey}.`); assert.ok(fontPath, 'must specify a font path'); assert.ok(typeof fontPath === 'string' || fontPath instanceof Buffer, 'font must be string path or Buffer'); assert.ok(opt.filename || !(fontPath instanceof Buffer), 'must specify filename if font is a Buffer'); @@ -67,7 +67,7 @@ function generateBMFont (fontPath, opt, callback) { // Set fallback output path to font path let fontDir = typeof fontPath === 'string' ? path.dirname(fontPath) : ''; - const binaryPath = path.join(__dirname, 'bin', process.platform, binName); + const binaryPath = path.join(__dirname, 'bin', platformKey, binName); // const reuse = (typeof opt.reuse === 'boolean' || typeof opt.reuse === 'undefined') ? {} : opt.reuse.opt; let reuse, cfg = {};