Skip to content

Commit cb7dbfe

Browse files
Fix npm workspace parsing bug
Reference: aboutcode-org/scancode.io#1521 Reported-by: @JonoYang Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent 1d0fe75 commit cb7dbfe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/packagedcode/npm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ def get_workspace_members(cls, workspaces, codebase, workspace_root_path):
444444
# Case 3: This is a complex glob pattern, we are doing a full codebase walk
445445
# and glob matching each resource
446446
else:
447-
for resource in workspace_root_path:
447+
workspace_root = codebase.get_resource(path=workspace_root_path)
448+
for resource in workspace_root.walk(codebase):
448449
if NpmPackageJsonHandler.is_datafile(resource.location) and fnmatch.fnmatch(
449450
name=resource.location, pat=workspace_path,
450451
):

0 commit comments

Comments
 (0)