Fix issue with layout tool and symlinks on Mac (#791)

* - Fix reversed symlink logic for Non-Windows file systems
- Add additional logic to clear existing symlink if it exists before re-applying

* Update to remove pre-existing reference regardless if its a symlink or not
This commit is contained in:
Steve Pham
2021-05-18 10:09:09 -07:00
committed by GitHub
parent 7109cbbc98
commit fed56805f5
+3 -1
View File
@@ -333,7 +333,9 @@ def create_link(src:pathlib.Path, tgt:pathlib.Path, copy):
import _winapi
_winapi.CreateJunction(str(src), str(tgt))
else:
src.symlink_to(tgt, target_is_directory=True)
if tgt.exists():
tgt.unlink()
tgt.symlink_to(src, target_is_directory=True)
except OSError as e:
raise common.LmbrCmdError(f"Error trying to create {link_type} {src} => {tgt} : {e}", e.errno)