Refactor: Simplify binary pattern handling in findBinary and findInstalledBinary functions
Test Action / test (push) Successful in 12s

This commit is contained in:
2026-04-07 09:43:53 +02:00
parent e8a9b0906d
commit 9138f03d35
4 changed files with 85 additions and 88 deletions
+2 -2
View File
@@ -189,13 +189,13 @@ async function run() {
console.log(`Extracting ${asset.name}...`);
await extractAsset(downloadPath, extractDir);
let binaryPattern: string | RegExp;
let binaryPattern: string;
if (binarySource.startsWith('~')) {
const binaryRegex = binarySource
.substring(1)
.replace(/{{SYSTEM}}/g, platformInfo.systemPattern)
.replace(/{{ARCH}}/g, platformInfo.archPattern);
binaryPattern = new RegExp(binaryRegex, 'i');
binaryPattern = `~${binaryRegex}`;
} else {
binaryPattern = binarySource
.replace(/{{SYSTEM}}/g, platformInfo.system)