mirror of https://github.com/aminya/setup-cpp
fix: fix cross-spawn exit codes
This commit is contained in:
parent
1a1befa1c9
commit
1a81d4edde
|
@ -30,7 +30,7 @@ export function setupAptPack(name: string, version?: string, repository: boolean
|
||||||
exit = spawn.sync(apt, ["install", name], { stdio: "inherit" }).status
|
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}`)
|
throw new Error(`Failed to install ${name} ${version}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
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}`)
|
throw new Error(`Failed to install ${name} ${version}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ export async function setupPipPack(name: string, version?: string) {
|
||||||
const exit = spawn.sync(pip, ["install", version !== undefined && version !== "" ? `${name}==${version}` : name], {
|
const exit = spawn.sync(pip, ["install", version !== undefined && version !== "" ? `${name}==${version}` : name], {
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
}).status
|
}).status
|
||||||
if (exit !== 0) {
|
if (exit !== 0 && exit !== null) {
|
||||||
throw new Error(`Failed to install ${name} ${version}`)
|
throw new Error(`Failed to install ${name} ${version}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue