Skip to content

Commit b84ae46

Browse files
committed
[SP-2587] Pr comments
1 parent 624802b commit b84ae46

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/scanoss/scanners/folder_hasher.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,7 @@ def _hash_calc(self, node: DirectoryNode) -> dict:
234234
file_name_without_extension, _ = os.path.splitext(file_name)
235235
current_directory = os.path.dirname(file.path)
236236

237-
last_directory = os.path.basename(current_directory)
238-
239-
if last_directory == '':
240-
last_directory = os.path.basename(os.getcwd())
237+
last_directory = Path(current_directory).name or Path(self.scan_dir).name
241238

242239
processed_hashes.add(key_str)
243240
unique_file_names.add(file_name_without_extension)

0 commit comments

Comments
 (0)