Skip to content

Commit 230cc6d

Browse files
taneltmmrts
authored andcommitted
fix: project cannot be built on windows
1 parent 3f41eda commit 230cc6d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/build-utils.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import fs from "fs-extra"
55
import archiver from "archiver";
66
import glob from 'glob';
77

8+
const isWindows = /^win/.test(process.platform);
9+
810
export const pkg = JSON.parse(fs.readFileSync("./package.json", 'utf8'));
911

1012
export function rem(...lines) {
@@ -35,6 +37,10 @@ export async function rm(globPattern) {
3537

3638
export function exec(command, args = []) {
3739
console.log(`EXEC ${command}${args.length ? ' ' + args.join(" ") : ''}`);
40+
41+
if (isWindows && command.toLowerCase() === "npx") {
42+
command += ".cmd";
43+
}
3844

3945
return new Promise((resolve, reject) => {
4046
const child = spawn(command, args);

0 commit comments

Comments
 (0)