@pnpm/link-bins
Advanced tools
Comparing version 6.1.0 to 6.2.0
@@ -6,2 +6,3 @@ import { DependencyManifest, ProjectManifest } from '@pnpm/types'; | ||
allowExoticManifests?: boolean; | ||
extendNodePath?: boolean; | ||
nodeExecPathByAlias?: Record<string, string>; | ||
@@ -17,3 +18,4 @@ projectManifest?: ProjectManifest; | ||
}>, binsTarget: string, opts: { | ||
extendNodePath?: boolean; | ||
warn: WarnFunction; | ||
}): Promise<string[]>; |
@@ -82,3 +82,3 @@ "use strict"; | ||
const [cmdsWithOwnName, cmdsWithOtherNames] = partition_1.default(({ ownName }) => ownName, allCmds); | ||
const results1 = await p_settle_1.default(cmdsWithOwnName.map(async (cmd) => linkBin(cmd, binsDir))); | ||
const results1 = await p_settle_1.default(cmdsWithOwnName.map(async (cmd) => linkBin(cmd, binsDir, opts))); | ||
const usedNames = fromPairs_1.default(cmdsWithOwnName.map((cmd) => [cmd.name, cmd.name])); | ||
@@ -91,3 +91,3 @@ const results2 = await p_settle_1.default(cmdsWithOtherNames.map(async (cmd) => { | ||
usedNames[cmd.name] = cmd.pkgName; | ||
return linkBin(cmd, binsDir); | ||
return linkBin(cmd, binsDir, opts); | ||
})); | ||
@@ -133,3 +133,3 @@ // We want to create all commands that we can create before throwing an exception | ||
} | ||
async function linkBin(cmd, binsDir) { | ||
async function linkBin(cmd, binsDir, opts) { | ||
const externalBinPath = path_1.default.join(binsDir, cmd.name); | ||
@@ -139,6 +139,9 @@ if (EXECUTABLE_SHEBANG_SUPPORTED) { | ||
} | ||
let nodePath = await getBinNodePaths(cmd.path); | ||
const binsParentDir = path_1.default.dirname(binsDir); | ||
if (path_1.default.relative(cmd.path, binsParentDir) !== '') { | ||
nodePath = union_1.default(nodePath, await getBinNodePaths(binsParentDir)); | ||
let nodePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.extendNodePath) !== false) { | ||
nodePath = await getBinNodePaths(cmd.path); | ||
const binsParentDir = path_1.default.dirname(binsDir); | ||
if (path_1.default.relative(cmd.path, binsParentDir) !== '') { | ||
nodePath = union_1.default(nodePath, await getBinNodePaths(binsParentDir)); | ||
} | ||
} | ||
@@ -145,0 +148,0 @@ return cmd_shim_1.default(cmd.path, externalBinPath, { |
{ | ||
"name": "@pnpm/link-bins", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "Link bins to node_modules/.bin", | ||
@@ -32,3 +32,3 @@ "main": "lib/index.js", | ||
"@pnpm/types": "7.4.0", | ||
"@zkochan/cmd-shim": "^5.2.0", | ||
"@zkochan/cmd-shim": "^5.2.1", | ||
"is-subdir": "^1.1.1", | ||
@@ -46,2 +46,3 @@ "is-windows": "^1.0.2", | ||
"@types/ramda": "0.27.39", | ||
"cmd-extension": "^1.0.2", | ||
"ncp": "^2.0.0", | ||
@@ -48,0 +49,0 @@ "path-exists": "^4.0.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
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
18622
184
9
Updated@zkochan/cmd-shim@^5.2.1