fix: make llvm installer less verbose for non-debug

This commit is contained in:
Amin Yahyaabadi 2023-08-21 19:29:23 -07:00
parent 912cd9add4
commit 99a4fe7118
16 changed files with 92 additions and 77 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33,6 +33,7 @@ export async function setupLLVMApt(majorVersion: number): Promise<InstallationIn
async function patchAptLLVMScript(path: string, target_path: string) {
let script = await readFile(path, "utf-8")
script = debugScript(script)
script = nonInteractiveScript(script)
script = await removeConflictingPAckages(script)
script = useNalaScript(script)
@ -42,9 +43,17 @@ async function patchAptLLVMScript(path: string, target_path: string) {
// the packages needed by the script
return [{ name: "lsb-release" }, { name: "wget" }, { name: "software-properties-common" }, { name: "gnupg" }]
}
function nonInteractiveScript(givenScript: string) {
function debugScript(script: string) {
if (!process.env.NODE_DEBUG) {
return script.replace(/set -eux/g, "set -eu")
}
return script
}
function nonInteractiveScript(script: string) {
// make the scirpt non-interactive and fix broken packages
return givenScript.replace(
return script.replace(
/add-apt-repository "\${REPO_NAME}"/g,
// eslint-disable-next-line no-template-curly-in-string
'add-apt-repository -y "${REPO_NAME}"',