fix: fix cross-spawn exit codes

This commit is contained in:
Amin Yahyaabadi 2021-09-17 15:08:19 -05:00
parent 1a1befa1c9
commit 1a81d4edde
3 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ export function setupAptPack(name: string, version?: string, repository: boolean
exit = spawn.sync(apt, ["install", name], { stdio: "inherit" }).status
}
if (exit !== 0) {
if (exit !== 0 && exit !== null) {
throw new Error(`Failed to install ${name} ${version}`)
}

View File

@ -21,7 +21,7 @@ export async function setupChocoPack(name: string, version?: string, args: strin
exit = spawn.sync("choco", ["install", "-y", name, ...args], { stdio: "inherit" }).status
}
if (exit !== 0) {
if (exit !== 0 && exit !== null) {
throw new Error(`Failed to install ${name} ${version}`)
}

View File

@ -28,7 +28,7 @@ export async function setupPipPack(name: string, version?: string) {
const exit = spawn.sync(pip, ["install", version !== undefined && version !== "" ? `${name}==${version}` : name], {
stdio: "inherit",
}).status
if (exit !== 0) {
if (exit !== 0 && exit !== null) {
throw new Error(`Failed to install ${name} ${version}`)
}