Skip to content

Changed 'aria2c --version' to 'LANG=en_US.UTF-8 aria2c --version' for consistent environment#495

Open
kei1-st wants to merge 2 commits into
snobu:sharepointfrom
kei1-st:sharepoint
Open

Changed 'aria2c --version' to 'LANG=en_US.UTF-8 aria2c --version' for consistent environment#495
kei1-st wants to merge 2 commits into
snobu:sharepointfrom
kei1-st:sharepoint

Conversation

@kei1-st

@kei1-st kei1-st commented Apr 22, 2024

Copy link
Copy Markdown

In my environment, $LANG=ja_JP.UTF-8 is set by default and the output of aria2c --version is in Japanese.

In that case, the value of the aria2Ver is "aria2 バージョン" instead of "aria2 version", which does not match versionRegex = RegExp(/aria2 version (. *)/) and followiing process throws an error.

destreamer/src/Utils.ts

Lines 216 to 229 in e93ad80

try {
const versionRegex = new RegExp(/aria2 version (.*)/);
const aira2Ver: string = execSync('aria2c --version').toString().split('\n')[0];
if (versionRegex.test(aira2Ver)) {
logger.verbose(`Using ${aira2Ver}\n`);
}
else {
throw new Error();
}
}
catch (e) {
process.exit(ERROR_CODE.MISSING_ARIA2);
}

To solve this problem, change execSync('aria2c --version') to execSync('LANG=en_US.UTF-8 aria2c --version') so that the output of the command aria2c --version is always in English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant