Fix: Enhance binary pattern matching with system and architecture replacements
All checks were successful
Test Action / test (push) Successful in 14s
All checks were successful
Test Action / test (push) Successful in 14s
This commit is contained in:
10
src/cli.ts
10
src/cli.ts
@@ -216,9 +216,15 @@ async function run() {
|
|||||||
|
|
||||||
let binaryPattern: string | RegExp;
|
let binaryPattern: string | RegExp;
|
||||||
if (binarySource.startsWith('~')) {
|
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 {
|
} else {
|
||||||
binaryPattern = binarySource;
|
binaryPattern = binarySource
|
||||||
|
.replace(/{{SYSTEM}}/g, platformInfo.system)
|
||||||
|
.replace(/{{ARCH}}/g, platformInfo.arch);
|
||||||
}
|
}
|
||||||
|
|
||||||
const binaryPath = findBinary(extractDir, binaryPattern, options.debug, console.log);
|
const binaryPath = findBinary(extractDir, binaryPattern, options.debug, console.log);
|
||||||
|
|||||||
Reference in New Issue
Block a user