Use relative symlinks
This commit is contained in:
parent
84f0d9e43d
commit
4d99747372
@ -398,6 +398,9 @@ def download_and_install_archive(download_url,
|
|||||||
for symlink_entry in exe_dict["symlink"]:
|
for symlink_entry in exe_dict["symlink"]:
|
||||||
symlink_dest = symlink_dir / symlink_entry
|
symlink_dest = symlink_dir / symlink_entry
|
||||||
symlink_src = exe_path
|
symlink_src = exe_path
|
||||||
|
symlink_rel_src = pathlib.Path(symlink_src).relative_to(install_dir)
|
||||||
|
symlink_rel_dest = pathlib.Path(symlink_dest).relative_to(install_dir)
|
||||||
|
|
||||||
skip_link = False;
|
skip_link = False;
|
||||||
if os.path.exists(symlink_dest):
|
if os.path.exists(symlink_dest):
|
||||||
# Windows uses hardlinks because symlinks require you to enable "developer" mode
|
# Windows uses hardlinks because symlinks require you to enable "developer" mode
|
||||||
@ -414,11 +417,13 @@ def download_and_install_archive(download_url,
|
|||||||
else:
|
else:
|
||||||
os.unlink(symlink_dest)
|
os.unlink(symlink_dest)
|
||||||
|
|
||||||
|
import contextlib
|
||||||
if not skip_link:
|
if not skip_link:
|
||||||
if use_hardlink:
|
if use_hardlink:
|
||||||
os.link(src=symlink_src, dst=symlink_dest)
|
os.link(src=symlink_src, dst=symlink_dest)
|
||||||
else:
|
else:
|
||||||
os.symlink(src=symlink_src, dst=symlink_dest)
|
with contextlib.chdir(install_dir):
|
||||||
|
os.symlink(src=symlink_rel_src, dst=symlink_dest)
|
||||||
|
|
||||||
# Collect paths to add to the devenv script
|
# Collect paths to add to the devenv script
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user