Merge pull request #472 from hsjobeki/main

nodejs: fix symlink issues
This commit is contained in:
DavHau 2023-02-19 17:49:30 +07:00 committed by GitHub
commit 34224b95bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,12 @@ def _create_package_from_derivation(
elif install_method == InstallMethod.symlink:
target.mkdir(parents=True, exist_ok=True)
for entry in os.listdir(dep.derivation):
(target / Path(entry)).symlink_to(dep.derivation / Path(entry))
if not (target / Path(entry)).exists():
(target / Path(entry)).symlink_to(dep.derivation / Path(entry))
else:
logger.info(
f"skipping: file {(target / Path(entry))} already exists."
)
binaries = get_bins(dep)
for name, rel_path in binaries.items():
@ -61,7 +66,7 @@ def _create_package_from_derivation(
class Passthrough(TypedDict):
"""
Wrapper class
Holds global informations during recursion in <_make_folders_rec>
Holds global information during recursion in <_make_folders_rec>
"""
all_deps: dict[str, Dependency]