Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only add directories we made to _sparseTreeRoots #6222

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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