Skip to content

Commit a98326d

Browse files
authored
Fix feature to automatically find manifest file (#243)
Signed-off-by: jiyeong.seok <[email protected]>
1 parent 644b742 commit a98326d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/fosslight_dependency/run_dependency_scanner.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def find_package_manager(input_dir, abs_path_to_exclude=[]):
6161
manifest_file_name.append(value)
6262

6363
found_manifest_file = []
64-
for (parent, _, files) in os.walk(input_dir):
64+
for parent, dirs, files in os.walk(input_dir):
6565
if len(files) < 1:
6666
continue
6767
if os.path.basename(parent) in _exclude_dir:
@@ -76,6 +76,13 @@ def find_package_manager(input_dir, abs_path_to_exclude=[]):
7676
continue
7777
if file in manifest_file_name:
7878
found_manifest_file.append(file)
79+
for dir in dirs:
80+
for manifest_f in manifest_file_name:
81+
manifest_l = manifest_f.split(os.path.sep)
82+
if len(manifest_l) > 1:
83+
if manifest_l[0] == dir:
84+
if os.path.exists(os.path.join(parent, manifest_f)):
85+
found_manifest_file.append(manifest_f)
7986
if len(found_manifest_file) > 0:
8087
input_dir = parent
8188
break

0 commit comments

Comments
 (0)