Skip to content

Commit 0f0472a

Browse files
prplxprplx
authored andcommitted
fix: make dist runner windows-safe
1 parent 8a6fec1 commit 0f0472a

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

scripts/run-dist.cjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ const npmBin = process.platform === "win32" ? "npm.cmd" : "npm";
66
const npxBin = process.platform === "win32" ? "npx.cmd" : "npx";
77

88
function run(command, args) {
9-
const result = spawnSync(command, args, {
10-
stdio: "inherit",
11-
shell: false
12-
});
9+
const result = process.platform === "win32"
10+
? spawnSync([command, ...args].join(" "), {
11+
stdio: "inherit",
12+
shell: true
13+
})
14+
: spawnSync(command, args, {
15+
stdio: "inherit",
16+
shell: false
17+
});
1318
if (result.error) throw result.error;
1419
return result.status ?? 0;
1520
}

0 commit comments

Comments
 (0)