File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
workspaces/arborist/lib/arborist Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -535,9 +535,14 @@ module.exports = cls => class Reifier extends cls {
535535 await this [ _renamePath ] ( d , retired )
536536 }
537537 }
538- const made = await mkdir ( node . path , { recursive : true } )
539538 this [ _sparseTreeDirs ] . add ( node . path )
540- this [ _sparseTreeRoots ] . add ( made )
539+ const made = await mkdir ( node . path , { recursive : true } )
540+ // 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+ }
541546 } ) )
542547 . then ( ( ) => process . emit ( 'timeEnd' , 'reify:createSparse' ) )
543548 }
You can’t perform that action at this time.
0 commit comments