Skip to content

Commit

Permalink
Explicitly ignore the root project
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2020 committed Oct 17, 2023
1 parent 1274ceb commit b256b12
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions node/flatpak_node_generator/providers/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,14 @@ def _process_packages_v2(
# NOTE We're not interested in symlinks, NPM will create them at install time
# but we still could collect package symlinks anyway just for completeness
continue
if install_path == "":
# The root project is typically listed with a key of ""
continue

name = info.get('name')

source: PackageSource
package_json_path = lockfile.parent / install_path / 'package.json'
if (
'node_modules' not in package_json_path.parts[:-1]
and package_json_path.exists()
):
source = LocalSource(path=install_path)
if name is None:
with package_json_path.open('rb') as fp:
name = json.load(fp)['name']
elif 'resolved' in info:
if 'resolved' in info:
resolved_url = urllib.parse.urlparse(info['resolved'])
if resolved_url.scheme == 'file':
source = LocalSource(path=resolved_url.path)
Expand Down

0 comments on commit b256b12

Please sign in to comment.