Skip to content

Commit

Permalink
Fix feature to automatically find manifest file
Browse files Browse the repository at this point in the history
Signed-off-by: jiyeong.seok <jiyeong.seok@lge.com>
  • Loading branch information
dd-jy committed Feb 21, 2025
1 parent 644b742 commit 7ec2201
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/fosslight_dependency/run_dependency_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def find_package_manager(input_dir, abs_path_to_exclude=[]):
manifest_file_name.append(value)

found_manifest_file = []
for (parent, _, files) in os.walk(input_dir):
for parent, dirs, files in os.walk(input_dir):
if len(files) < 1:
continue
if os.path.basename(parent) in _exclude_dir:
Expand All @@ -76,6 +76,13 @@ def find_package_manager(input_dir, abs_path_to_exclude=[]):
continue
if file in manifest_file_name:
found_manifest_file.append(file)
for dir in dirs:
for manifest_f in manifest_file_name:
manifest_l = manifest_f.split(os.path.sep)
if len(manifest_l) > 1:
if manifest_l[0] == dir:
if os.path.exists(os.path.join(parent, manifest_f)):
found_manifest_file.append(manifest_f)
if len(found_manifest_file) > 0:
input_dir = parent
break
Expand Down

0 comments on commit 7ec2201

Please sign in to comment.