Skip to content

Commit

Permalink
fix: fallback to node.path if fs.mkdir returns undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf committed Mar 2, 2023
1 parent ef2674f commit b02c561
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion workspaces/arborist/lib/arborist/reify.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@ module.exports = cls => class Reifier extends cls {
await this[_renamePath](d, retired)
}
}
const made = await mkdir(node.path, { recursive: true })
// fs.mkdir will return undefined if the path already exists. if that happens
// then node.path is the sparse tree root
const made = await mkdir(node.path, { recursive: true }) || node.path
this[_sparseTreeDirs].add(node.path)
this[_sparseTreeRoots].add(made)
}))
Expand Down

0 comments on commit b02c561

Please sign in to comment.