From 43a306b556c4a81c71e10d69ad40fcc31ed934e6 Mon Sep 17 00:00:00 2001 From: Manuel <39829645+manuel2295@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:48:38 +0100 Subject: [PATCH] Fix: "regex aria2" for multilingual aria2 system output --- src/Utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Utils.ts b/src/Utils.ts index c9218e6..138ce83 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -214,11 +214,11 @@ export function checkRequirements(): void { } try { - const versionRegex = new RegExp(/aria2 version (.*)/); - const aira2Ver: string = execSync('aria2c --version').toString().split('\n')[0]; + const versionRegex = new RegExp(/aria2 [a-z]+ ([0-9.]+)/); + const aria2Ver: string = execSync('aria2c --version').toString(); - if (versionRegex.test(aira2Ver)) { - logger.verbose(`Using ${aira2Ver}\n`); + if (versionRegex.test(aria2Ver)) { + logger.verbose(`Using ${aria2Ver}\n`); } else { throw new Error();