Skip to content

Commit

Permalink
Merge pull request #7728 from blink1073/linked-extension-check
Browse files Browse the repository at this point in the history
Fix handling of linked extensions
  • Loading branch information
jasongrout committed Jan 6, 2020
2 parents 0909afa + ec4285b commit 84ec48a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jupyterlab/commands.py
Expand Up @@ -1194,13 +1194,15 @@ def format_path(path):
# Handle local extensions.
for (key, source) in local.items():
jlab['linkedPackages'][key] = source
data['resolutions'][key] = source

# Handle linked packages.
for (key, item) in linked.items():
path = pjoin(self.app_dir, 'staging', 'linked_packages')
path = pjoin(path, item['filename'])
data['dependencies'][key] = format_path(path)
jlab['linkedPackages'][key] = item['source']
data['resolutions'][key] = format_path(path)

# Handle extensions
compat_errors = self._get_extension_compat()
Expand Down Expand Up @@ -1256,6 +1258,9 @@ def _update_local(self, name, source, dname, data, dtype):
"""
# Extract the package in a temporary directory.
existing = data['filename']
if not osp.exists(pjoin(dname, existing)):
existing = ''

with TemporaryDirectory() as tempdir:
info = self._extract_package(source, tempdir)

Expand All @@ -1265,7 +1270,7 @@ def _update_local(self, name, source, dname, data, dtype):

shutil.move(info['path'], pjoin(dname, info['filename']))

# Remove the existing tarball and return the new file name.
# Remove the previous tarball and return the new file name.
if existing:
os.remove(pjoin(dname, existing))

Expand Down

0 comments on commit 84ec48a

Please sign in to comment.