Skip to content

Commit

Permalink
force the use of the spawn shell for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
vanyauhalin committed Jul 2, 2024
1 parent c58e6ed commit 2c58792
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion makefile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function run(cmd: string): Promise<void> {
continue
}
await new Promise((res, rej) => {
const s = spawn("pnpm", [cmd], {cwd: d, stdio: "inherit"})
const s = spawn("pnpm", [cmd], {cwd: d, shell: true, stdio: "inherit"})
s.on("close", res)
s.on("error", rej)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/jq/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function hasJQ(): Promise<boolean> {

export function jq(w: Writable, opts: string[] = []): Promise<void> {
return new Promise((res, rej) => {
const s = spawn("jq", ["--monochrome-output", ...opts])
const s = spawn("jq", ["--monochrome-output", ...opts], {shell: true})
s.stdout.on("data", (ch) => {
w.write(ch)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/jsdoc/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export type CatharsisType =

export function jsdoc(w: Writable, opts: string[]): Promise<void> {
return new Promise((res, rej) => {
const s = spawn("pnpm", ["exec", "--", "jsdoc", ...opts])
const s = spawn("pnpm", ["exec", "--", "jsdoc", ...opts], {shell: true})
s.stdout.on("data", (ch) => {
w.write(ch)
})
Expand Down
10 changes: 8 additions & 2 deletions packages/server-client/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ async function main(): Promise<void> {
}

function spawnServer(): ReturnType<typeof spawn> {
return spawn("pnpm", ["run", "demo:server"], {stdio: ["pipe", "pipe", "pipe"]})
return spawn("pnpm", ["run", "demo:server"], {
shell: true,
stdio: ["pipe", "pipe", "pipe"],
})
}

async function waitServer(): Promise<boolean> {
Expand All @@ -49,7 +52,10 @@ async function waitServer(): Promise<boolean> {
}

function spawnTest(): ReturnType<typeof spawn> {
return spawn("pnpm", ["run", "test:all"], {stdio: "inherit"})
return spawn("pnpm", ["run", "test:all"], {
shell: true,
stdio: "inherit",
})
}

let c = 0
Expand Down

0 comments on commit 2c58792

Please sign in to comment.