[Diff][Fixed] Problems with overwriting the symlink

This commit is contained in:
Salvador E. Tropea 2022-09-02 08:14:15 -03:00
parent 1ff365b572
commit d834ba5075
1 changed files with 2 additions and 0 deletions

View File

@ -293,6 +293,8 @@ class DiffOptions(BaseOptions):
if self.copy_instead_of_link:
copy2(name, target)
else:
if os.path.isfile(target):
os.remove(target)
os.symlink(os.path.basename(name), target)
finally:
# Clean-up