Skip to content

Commit 1a81d4e

Browse files
committed
fix: fix cross-spawn exit codes
1 parent 1a1befa commit 1a81d4e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/utils/setup/setupAptPack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function setupAptPack(name: string, version?: string, repository: boolean
3030
exit = spawn.sync(apt, ["install", name], { stdio: "inherit" }).status
3131
}
3232

33-
if (exit !== 0) {
33+
if (exit !== 0 && exit !== null) {
3434
throw new Error(`Failed to install ${name} ${version}`)
3535
}
3636

src/utils/setup/setupChocoPack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function setupChocoPack(name: string, version?: string, args: strin
2121
exit = spawn.sync("choco", ["install", "-y", name, ...args], { stdio: "inherit" }).status
2222
}
2323

24-
if (exit !== 0) {
24+
if (exit !== 0 && exit !== null) {
2525
throw new Error(`Failed to install ${name} ${version}`)
2626
}
2727

src/utils/setup/setupPipPack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function setupPipPack(name: string, version?: string) {
2828
const exit = spawn.sync(pip, ["install", version !== undefined && version !== "" ? `${name}==${version}` : name], {
2929
stdio: "inherit",
3030
}).status
31-
if (exit !== 0) {
31+
if (exit !== 0 && exit !== null) {
3232
throw new Error(`Failed to install ${name} ${version}`)
3333
}
3434

0 commit comments

Comments
 (0)