File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -712,10 +712,17 @@ extension Workspace {
712
712
try fileSystem. createDirectory ( editablesPath)
713
713
// FIXME: We need this to work with InMem file system too.
714
714
if !( fileSystem is InMemoryFileSystem ) {
715
- try createSymlink (
716
- editablesPath. appending ( component: packageName) ,
717
- pointingAt: path,
718
- relative: false )
715
+ let symLinkPath = editablesPath. appending ( component: packageName)
716
+
717
+ // Cleanup any existing symlink.
718
+ if fileSystem. isSymlink ( symLinkPath) {
719
+ try fileSystem. removeFileTree ( symLinkPath)
720
+ }
721
+
722
+ // FIXME: We should probably just warn in case we fail to create
723
+ // this symlink, which could happen if there is some non-symlink
724
+ // entry at this location.
725
+ try createSymlink ( symLinkPath, pointingAt: path, relative: false )
719
726
}
720
727
}
721
728
You can’t perform that action at this time.
0 commit comments