Skip to content

Commit e0836d7

Browse files
committed
meh
1 parent 1decb61 commit e0836d7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib_dev/process.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import * as child_process from "node:child_process";
22
import * as fs from "node:fs/promises";
33
import * as path from "node:path";
4-
import { execPath } from "node:process";
54
import { bsc_exe, rescript_legacy_exe } from "#cli/bins";
65

7-
const npmBin = path.join(path.dirname(execPath), "npm");
8-
96
/**
107
* @typedef {{
118
* throwOnFail?: boolean,
@@ -53,14 +50,18 @@ export function setup(cwd = process.cwd()) {
5350
async function exec(command, args = [], options = {}) {
5451
const { throwOnFail = options.stdio === "inherit" } = options;
5552

53+
if (process.env.CI) {
54+
console.log("[exec] PATH =", options.env?.PATH ?? process.env.PATH);
55+
}
56+
5657
const stdoutChunks = [];
5758
const stderrChunks = [];
5859

5960
const subprocess = child_process.spawn(command, args, {
6061
cwd,
6162
shell: process.platform === "win32",
6263
stdio: ["ignore", "pipe", "pipe"],
63-
env: { ...process.env, ...options.env },
64+
env: options.env ? { ...process.env, ...options.env } : process.env,
6465
...options,
6566
});
6667

@@ -255,7 +256,7 @@ export function setup(cwd = process.cwd()) {
255256
* @return {Promise<ExecResult>}
256257
*/
257258
npm(args = [], options = {}) {
258-
return exec(npmBin, args, options);
259+
return exec("npm", args, options);
259260
},
260261
};
261262
}

0 commit comments

Comments
 (0)