We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4de224 commit 8a78c6fCopy full SHA for 8a78c6f
1 file changed
workspaces/arborist/lib/arborist/reify.js
@@ -535,9 +535,14 @@ module.exports = cls => class Reifier extends cls {
535
await this[_renamePath](d, retired)
536
}
537
538
- const made = await mkdir(node.path, { recursive: true })
539
this[_sparseTreeDirs].add(node.path)
540
- 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
541
+ // we don't want to remove it because we aren't the ones who created it so we
542
+ // omit it from the _sparseTreeRoots
543
+ if (made) {
544
+ this[_sparseTreeRoots].add(made)
545
+ }
546
}))
547
.then(() => process.emit('timeEnd', 'reify:createSparse'))
548
0 commit comments