Resovle symlink based on the saved cwd

This commit is contained in:
Ivan Kravets
2022-04-05 09:07:44 +03:00
parent e2f21212b7
commit fb2f3c8836
2 changed files with 9 additions and 8 deletions
+3 -5
View File
@@ -33,11 +33,9 @@ class PackageManagerSymlinkMixin(object):
data = json.load(fp)
spec = PackageSpec(**data["spec"])
assert spec.symlink
pkg_dir = os.path.realpath(spec.uri[10:])
if not os.path.isdir(pkg_dir):
with fs.cd(data["cwd"]):
pkg_dir = os.path.realpath(pkg_dir)
return (pkg_dir if os.path.isdir(pkg_dir) else None, spec)
with fs.cd(data["cwd"]):
pkg_dir = os.path.realpath(pkg_dir)
return (pkg_dir if os.path.isdir(pkg_dir) else None, spec)
def get_symlinked_package(self, path):
pkg_dir, spec = self.resolve_symlink(path)