@pnpm/link-bins
Advanced tools
Comparing version 4.3.1 to 4.4.0
@@ -1,1 +0,1 @@ | ||
export default function (modules: string, warn: (msg: string) => void): Promise<string[]>; | ||
export default function (modules: string): Promise<string[]>; |
@@ -7,6 +7,6 @@ "use strict"; | ||
const path = require("path"); | ||
async function default_1(modules, warn) { | ||
const dirs = await getDirectories(modules, warn); | ||
async function default_1(modules) { | ||
const dirs = await getDirectories(modules); | ||
const subdirs = await Promise.all(dirs.map((dir) => { | ||
return isScopedPkgsDir(dir) ? getDirectories(dir, warn) : Promise.resolve([dir]); | ||
return isScopedPkgsDir(dir) ? getDirectories(dir) : Promise.resolve([dir]); | ||
})); | ||
@@ -16,3 +16,3 @@ return flatten(subdirs); | ||
exports.default = default_1; | ||
async function getDirectories(srcPath, warn) { | ||
async function getDirectories(srcPath) { | ||
let dirs; | ||
@@ -29,3 +29,3 @@ try { | ||
return pFilter(dirs | ||
.filter((relativePath) => relativePath[0] !== '.') // ignore directories like .bin, .store, etc | ||
.filter((relativePath) => !relativePath.startsWith('.')) // ignore directories like .bin, .store, etc | ||
.map((relativePath) => path.join(srcPath, relativePath)), async (absolutePath) => { | ||
@@ -39,3 +39,5 @@ try { | ||
throw err; | ||
warn(`Cannot find file at ${absolutePath} although it was listed by readdir`); | ||
// Cannot find file at ${absolutePath} although it was listed by readdir. | ||
// This probably means that the target of the symlink does not exist (broken symlink). | ||
// This used to be a warning but it didn't really cause any issues. | ||
return false; | ||
@@ -46,4 +48,4 @@ } | ||
function isScopedPkgsDir(dirPath) { | ||
return path.basename(dirPath)[0] === '@'; | ||
return path.basename(dirPath).startsWith('@'); | ||
} | ||
//# sourceMappingURL=getPkgDirs.js.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
exports.default = async (modules, binPath, opts) => { | ||
const pkgDirs = await getPkgDirs_1.default(modules, opts.warn); | ||
const pkgDirs = await getPkgDirs_1.default(modules); | ||
const pkgBinOpts = Object.assign({ allowExoticManifests: false }, opts); | ||
@@ -58,3 +58,4 @@ const allCmds = R.unnest((await Promise.all(pkgDirs | ||
if (!pkg) { | ||
opts.warn(`There's a directory in node_modules without package.json: ${target}`); | ||
// There's a directory in node_modules without package.json: ${target}. | ||
// This used to be a warning but it didn't really cause any issues. | ||
return []; | ||
@@ -61,0 +62,0 @@ } |
{ | ||
"name": "@pnpm/link-bins", | ||
"version": "4.3.1", | ||
"version": "4.4.0", | ||
"description": "Link bins to node_modules/.bin", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
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
15509
161