Skip to content

Commit

Permalink
fixup! deps: @npmcli/fs@3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Nov 7, 2022
1 parent 8c36134 commit abcec7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/utils/completion/installed-shallow.js
@@ -1,7 +1,9 @@
const { readdirScoped } = require('@npmcli/fs')
const { posix } = require('path')

const installedShallow = async (npm, opts) => {
const names = global => readdirScoped(global ? npm.globalDir : npm.localDir)
.then(list => list.map(i => posix.join(i)))
const { conf: { argv: { remain } } } = opts
if (remain.length > 3) {
return null
Expand Down
7 changes: 4 additions & 3 deletions workspaces/arborist/lib/arborist/build-ideal-tree.js
Expand Up @@ -6,7 +6,7 @@ const pacote = require('pacote')
const cacache = require('cacache')
const promiseCallLimit = require('promise-call-limit')
const realpath = require('../../lib/realpath.js')
const { resolve, dirname } = require('path')
const { resolve, dirname, posix } = require('path')
const treeCheck = require('../tree-check.js')
const { readdirScoped } = require('@npmcli/fs')
const { lstat, readlink } = require('fs/promises')
Expand Down Expand Up @@ -446,14 +446,15 @@ module.exports = cls => class IdealTreeBuilder extends cls {
const globalExplicitUpdateNames = []
if (this[_global] && (this[_updateAll] || this[_updateNames].length)) {
const nm = resolve(this.path, 'node_modules')
for (const name of await readdirScoped(nm).catch(() => [])) {
for (const namePath of await readdirScoped(nm).catch(() => [])) {
const name = posix.join(namePath)
tree.package.dependencies = tree.package.dependencies || {}
const updateName = this[_updateNames].includes(name)
if (this[_updateAll] || updateName) {
if (updateName) {
globalExplicitUpdateNames.push(name)
}
const dir = resolve(nm, name)
const dir = resolve(nm, namePath)
const st = await lstat(dir)
.catch(/* istanbul ignore next */ er => null)
if (st && st.isSymbolicLink()) {
Expand Down

0 comments on commit abcec7a

Please sign in to comment.