Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: sharepoint
Choose a base branch
from

Conversation

kei1-st
Copy link

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

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