fix: set stdio: inherit for all exec calls

This commit is contained in:
Amin Yahyaabadi 2022-02-13 16:06:21 -08:00
parent e6efc4aca9
commit 4b250a3ca2
9 changed files with 24 additions and 20 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

View File

@ -39,7 +39,9 @@ export function setupChocolatey(
}
// https://docs.chocolatey.org/en-us/choco/setup#install-with-cmd.exe
execa.sync(powershell, [
execa.sync(
powershell,
[
"-NoProfile",
"-InputFormat",
"None",
@ -47,7 +49,9 @@ export function setupChocolatey(
"Bypass",
"-Command",
"[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))",
])
],
{ stdio: "inherit" }
)
const chocoPath = `${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`
addPath(chocoPath)

View File

@ -34,8 +34,8 @@ function getKcovPackageInfo(version: string): PackageInfo {
// await setupCmake("3.22.0", join(untildify(""), "cmake"), "")
await setupAptPack("libdw-dev")
await setupAptPack("libcurl4-openssl-dev")
await execa("cmake", ["-S", "./", "-B", "./build"], { cwd: out })
await execa("cmake", ["--build", "./build", "--config", "Release"], { cwd: out })
await execa("cmake", ["-S", "./", "-B", "./build"], { cwd: out, stdio: "inherit" })
await execa("cmake", ["--build", "./build", "--config", "Release"], { cwd: out, stdio: "inherit" })
await execSudo("cmake", ["--install", "./build"], out)
return out
},

View File

@ -18,5 +18,5 @@ export function execPowershell(command: string) {
throw new Error("Could not find powershell")
}
execa.sync(powershell, ["-c", command])
execa.sync(powershell, ["-c", command], { stdio: "inherit" })
}

View File

@ -9,6 +9,6 @@ export function execSudo(file: string, args: string[], cwd?: string) {
stdio: "inherit",
})
} else {
return execa(file, args)
return execa(file, args, { stdio: "inherit" })
}
}

View File

@ -16,7 +16,7 @@ export async function extractExe(file: string, dest: string) {
sevenZip = "7z"
}
await execa(sevenZip, ["x", file, `-o${dest}`])
await execa(sevenZip, ["x", file, `-o${dest}`], { stdio: "inherit" })
return dest
}
@ -26,6 +26,6 @@ export async function extractTarByExe(file: string, dest: string, flags = ["--st
} catch {
// ignore
}
await execa("tar", ["xf", file, "-C", dest, ...flags])
await execa("tar", ["xf", file, "-C", dest, ...flags], { stdio: "inherit" })
return dest
}

View File

@ -38,7 +38,7 @@ export async function setupPipPack(name: string, version?: string): Promise<Inst
}
if (process.platform === "win32") {
// https://github.com/pypa/pip/issues/10875#issuecomment-1030293005
execa.sync(python, ["-m", "pip", "install", "-U", "pip==21.3.1"])
execa.sync(python, ["-m", "pip", "install", "-U", "pip==21.3.1"], { stdio: "inherit" })
}
execa.sync(python, ["-m", "pip", "install", version !== undefined && version !== "" ? `${name}==${version}` : name], {

View File

@ -23,12 +23,12 @@ export async function setupVcpkg(_version: string, setupDir: string, _arch: stri
}
if (!existsSync(join(setupDir, addShellExtension("bootstrap-vcpkg")))) {
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: dirname(setupDir) })
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: dirname(setupDir), stdio: "inherit" })
} else {
warning(`Vcpkg folder already exists at ${setupDir}`)
}
execa.sync(addShellExtension(addShellHere("bootstrap-vcpkg")), { cwd: setupDir, shell: true })
execa.sync(addShellExtension(addShellHere("bootstrap-vcpkg")), { cwd: setupDir, shell: true, stdio: "inherit" })
addPath(setupDir)
// eslint-disable-next-line require-atomic-updates
hasVCPKG = true