From cbfadf34887e0d23dd98f53d40c7bfe384020e2a Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Mon, 6 Apr 2026 23:33:46 +0200 Subject: [PATCH] Fix: Enhance binary pattern matching with system and architecture replacements --- src/cli.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 90d1cb1..481370d 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -216,9 +216,15 @@ async function run() { let binaryPattern: string | RegExp; if (binarySource.startsWith('~')) { - binaryPattern = new RegExp(binarySource.substring(1), 'i'); + const binaryRegex = binarySource + .substring(1) + .replace(/{{SYSTEM}}/g, platformInfo.systemPattern) + .replace(/{{ARCH}}/g, platformInfo.archPattern); + binaryPattern = new RegExp(binaryRegex, 'i'); } else { - binaryPattern = binarySource; + binaryPattern = binarySource + .replace(/{{SYSTEM}}/g, platformInfo.system) + .replace(/{{ARCH}}/g, platformInfo.arch); } const binaryPath = findBinary(extractDir, binaryPattern, options.debug, console.log);