Skip to content

Commit

Permalink
Update test-util.ts
Browse files Browse the repository at this point in the history
fix windows pathing
  • Loading branch information
dev2-nomo committed Nov 29, 2023
1 parent 960bad8 commit 3c09199
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/test-util/test-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { exec } from "child_process";
import { join } from "path";

export function buildCliCommand(args: string) {
return `node bin\\nomo-webon-cli ${args}`;
if (process.platform === "win32") {
return `node "${join(process.cwd(), "bin", "nomo-webon-cli").replace(
/\\/g,
"\\\\"
)}" ${args}`;
return `node bin\nomo-webon-cli ${args}`;
} else {
return `${join(process.cwd(), "bin", "nomo-webon-cli")} ${args}`;
}
Expand Down Expand Up @@ -70,7 +68,7 @@ function runCommandExpectFailure(

function buildFinalCommand(cmd: string, pwd?: string) {
if (pwd) {
return `( cd "${pwd}" && ${cmd} )`;
return cmd;
} else {
return cmd;
}
Expand Down

0 comments on commit 3c09199

Please sign in to comment.