@pnpm/link-bins
Advanced tools
Comparing version 8.0.9 to 8.0.10
@@ -8,2 +8,3 @@ "use strict"; | ||
const fs_1 = require("fs"); | ||
const module_1 = __importDefault(require("module")); | ||
const path_1 = __importDefault(require("path")); | ||
@@ -160,5 +161,15 @@ const error_1 = require("@pnpm/error"); | ||
try { | ||
let nodePath; | ||
if (opts?.extraNodePaths?.length) { | ||
nodePath = []; | ||
for (const modulesPath of await getBinNodePaths(cmd.path)) { | ||
if (opts.extraNodePaths.includes(modulesPath)) | ||
break; | ||
nodePath.push(modulesPath); | ||
} | ||
nodePath.push(...opts.extraNodePaths); | ||
} | ||
await (0, cmd_shim_1.default)(cmd.path, externalBinPath, { | ||
createPwshFile: cmd.makePowerShellShim, | ||
nodePath: opts?.extraNodePaths, | ||
nodePath, | ||
nodeExecPath: cmd.nodeExecPath, | ||
@@ -189,2 +200,17 @@ }); | ||
} | ||
async function getBinNodePaths(target) { | ||
const targetDir = path_1.default.dirname(target); | ||
try { | ||
const targetRealPath = await fs_1.promises.realpath(targetDir); | ||
// @ts-expect-error | ||
return module_1.default['_nodeModulePaths'](targetRealPath); | ||
} | ||
catch (err) { // eslint-disable-line | ||
if (err.code !== 'ENOENT') { | ||
throw err; | ||
} | ||
// @ts-expect-error | ||
return module_1.default['_nodeModulePaths'](targetDir); | ||
} | ||
} | ||
async function safeReadPkgJson(pkgDir) { | ||
@@ -191,0 +217,0 @@ try { |
{ | ||
"name": "@pnpm/link-bins", | ||
"version": "8.0.9", | ||
"version": "8.0.10", | ||
"description": "Link bins to node_modules/.bin", | ||
@@ -51,3 +51,3 @@ "main": "lib/index.js", | ||
"tempy": "^1.0.1", | ||
"@pnpm/link-bins": "8.0.9", | ||
"@pnpm/link-bins": "8.0.10", | ||
"@pnpm/test-fixtures": "0.0.33" | ||
@@ -54,0 +54,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22091
241
5