fix: use stdio inherit for execa.sync brew and apt

This commit is contained in:
Amin Yahyaabadi 2022-01-30 18:15:28 -08:00
parent 6d9651573c
commit d7ccf0506b
4 changed files with 10 additions and 4 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

@ -3,7 +3,11 @@ import { isRoot } from "../env/sudo"
export function execSudo(file: string, args: string[], cwd?: string) { export function execSudo(file: string, args: string[], cwd?: string) {
if (isRoot()) { if (isRoot()) {
return execa.command(`sudo ${[file, ...args].map((arg) => `'${arg}'`).join(" ")}`, { shell: true, cwd }) return execa.command(`sudo ${[file, ...args].map((arg) => `'${arg}'`).join(" ")}`, {
shell: true,
cwd,
stdio: "inherit",
})
} else { } else {
return execa(file, args) return execa(file, args)
} }

View File

@ -14,7 +14,9 @@ export function setupBrewPack(name: string, version?: string): InstallationInfo
} }
// brew is not thread-safe // brew is not thread-safe
execa.sync("brew", ["install", version !== undefined && version !== "" ? `${name}@${version}` : name]) execa.sync("brew", ["install", version !== undefined && version !== "" ? `${name}@${version}` : name], {
stdio: "inherit",
})
return { binDir: "/usr/local/bin/" } return { binDir: "/usr/local/bin/" }
} }