Skip to content

Commit 57bd9d9

Browse files
committed
Add support for storing top-level paths of the codebase
Signed-off-by: Aayush Kumar <aayush214.kumar@gmail.com>
1 parent 6a397f3 commit 57bd9d9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

scanpipe/pipes/rootfs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ def get_res(parent, fname):
139139
rootfs_path=rootfs_path,
140140
)
141141

142+
if with_dir:
143+
rootfs_path = pipes.normalize_path("")
144+
yield Resource(
145+
location=location,
146+
rootfs_path=rootfs_path,
147+
)
148+
142149
for top, dirs, files in os.walk(location):
143150
for f in files:
144151
yield get_res(parent=top, fname=f)

scanpipe/tests/test_pipelines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ def test_scanpipe_rootfs_pipeline_integration(self):
12051205
exitcode, out = pipeline.execute()
12061206
self.assertEqual(0, exitcode, msg=out)
12071207

1208-
self.assertEqual(16, project1.codebaseresources.count())
1208+
self.assertEqual(17, project1.codebaseresources.count())
12091209
self.assertEqual(2, project1.discoveredpackages.count())
12101210
self.assertEqual(0, project1.discovereddependencies.count())
12111211

0 commit comments

Comments
 (0)