MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / npmRunPath

Function npmRunPath

out/cli.cjs:65924–65941  ·  view source on GitHub ↗
({
  cwd = import_node_process4.default.cwd(),
  path: pathOption = import_node_process4.default.env[pathKey()],
  preferLocal = true,
  execPath = import_node_process4.default.execPath,
  addExecPath = true
} = {})

Source from the content-addressed store, hash-verified

65922 } = options;
65923 if (platform !== "win32") {
65924 return "PATH";
65925 }
65926 return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
65927}
65928
65929// node_modules/npm-run-path/index.js
65930var npmRunPath = ({
65931 cwd = import_node_process4.default.cwd(),
65932 path: pathOption = import_node_process4.default.env[pathKey()],
65933 preferLocal = true,
65934 execPath = import_node_process4.default.execPath,
65935 addExecPath = true
65936} = {}) => {
65937 const cwdString = cwd instanceof URL ? (0, import_node_url.fileURLToPath)(cwd) : cwd;
65938 const cwdPath = import_node_path.default.resolve(cwdString);
65939 const result = [];
65940 if (preferLocal) {
65941 applyPreferLocal(result, cwdPath);
65942 }
65943 if (addExecPath) {
65944 applyExecPath(result, execPath, cwdPath);

Callers 1

npmRunPathEnvFunction · 0.85

Calls 3

pathKeyFunction · 0.85
applyPreferLocalFunction · 0.85
applyExecPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…