Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/test-package.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ function run(command, args, options = {}) {
}

try {
// shell: true - required on Windows to spawn a .cmd shim (npm.cmd) at all;
// Node's spawnSync can't exec one directly without going through a shell.
// Safe here specifically because these args are internally generated
// (this repo's own paths and fixed flag strings), never user input.
const packed = JSON.parse(
run(
npmCommand,
Expand All @@ -47,7 +51,7 @@ try {
"--pack-destination",
consumerRoot,
],
{ cwd: projectRoot },
{ cwd: projectRoot, shell: true },
),
);
const archive = join(consumerRoot, packed[0].filename);
Expand All @@ -60,7 +64,7 @@ try {
type: "module",
}),
);
run(npmCommand, ["install", "--ignore-scripts", archive]);
run(npmCommand, ["install", "--ignore-scripts", archive], { shell: true });

const packageName = "@compas-dev/compas-threejs-ts";
const installed = JSON.parse(
Expand Down
Loading