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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user