fix: enable UTF8 only once for nala

This commit is contained in:
Amin Yahyaabadi 2022-07-27 17:51:13 -07:00
parent 0cedb62c7b
commit 2915ec8f01
5 changed files with 9 additions and 8 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/setup_cpp.mjs vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -59,10 +59,6 @@ function getApt() {
let apt: string
if (which.sync("nala", { nothrow: true }) !== null) {
apt = "nala"
// enable utf8 otherwise it fails because of the usage of ASCII encoding
addEnv("LANG", "C.UTF-8")
addEnv("LC_ALL", "C.UTF-8")
} else {
apt = "apt-get"
}
@ -91,6 +87,11 @@ function initApt(apt: string) {
} catch (err) {
warning(`Failed to add keys: ${err}`)
}
if (apt === "nala") {
// enable utf8 otherwise it fails because of the usage of ASCII encoding
addEnv("LANG", "C.UTF-8")
addEnv("LC_ALL", "C.UTF-8")
}
}
export function updateAptAlternatives(name: string, path: string) {