Skip to content

Commit

Permalink
fix: only add directories we made to _sparseTreeRoots (#6222)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf authored Mar 8, 2023
1 parent e4de224 commit 8a78c6f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions workspaces/arborist/lib/arborist/reify.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,14 @@ module.exports = cls => class Reifier extends cls {
await this[_renamePath](d, retired)
}
}
const made = await mkdir(node.path, { recursive: true })
this[_sparseTreeDirs].add(node.path)
this[_sparseTreeRoots].add(made)
const made = await mkdir(node.path, { recursive: true })
// if the directory already exists, made will be undefined. if that's the case
// we don't want to remove it because we aren't the ones who created it so we
// omit it from the _sparseTreeRoots
if (made) {
this[_sparseTreeRoots].add(made)
}
}))
.then(() => process.emit('timeEnd', 'reify:createSparse'))
}
Expand Down

0 comments on commit 8a78c6f

Please # to comment.