File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,15 @@ async function forceSymlink (
8888 warn = `Symlink wanted name was occupied by directory or file. Old entity removed: "${ parentDir } ${ pathLib . sep } {${ pathLib . basename ( path ) } ".`
8989 } else {
9090 const ignore = `.ignored_${ pathLib . basename ( path ) } `
91- await renameOverwrite ( path , pathLib . join ( parentDir , ignore ) )
91+ try {
92+ await renameOverwrite ( path , pathLib . join ( parentDir , ignore ) )
93+ } catch ( error ) {
94+ if ( util . types . isNativeError ( error ) && 'code' in error && error . code === 'ENOENT' ) {
95+ throw initialErr
96+ }
97+ throw error
98+ }
99+
92100 warn = `Symlink wanted name was occupied by directory or file. Old entity moved: "${ parentDir } ${ pathLib . sep } {${ pathLib . basename ( path ) } => ${ ignore } ".`
93101 }
94102
@@ -185,7 +193,14 @@ function forceSymlinkSync (
185193 warn = `Symlink wanted name was occupied by directory or file. Old entity removed: "${ parentDir } ${ pathLib . sep } {${ pathLib . basename ( path ) } ".`
186194 } else {
187195 const ignore = `.ignored_${ pathLib . basename ( path ) } `
188- renameOverwrite . sync ( path , pathLib . join ( parentDir , ignore ) )
196+ try {
197+ renameOverwrite . sync ( path , pathLib . join ( parentDir , ignore ) )
198+ } catch ( error ) {
199+ if ( util . types . isNativeError ( error ) && 'code' in error && error . code === 'ENOENT' ) {
200+ throw initialErr
201+ }
202+ throw error
203+ }
189204 warn = `Symlink wanted name was occupied by directory or file. Old entity moved: "${ parentDir } ${ pathLib . sep } {${ pathLib . basename ( path ) } => ${ ignore } ".`
190205 }
191206
You can’t perform that action at this time.
0 commit comments