Skip to content

Commit f6573db

Browse files
committed
fix/handle-no-ecosystem-case
1 parent e892245 commit f6573db

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

safety/scan/command.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,13 @@ def scan(ctx: typer.Context,
737737
path, file_paths = scan_project_directory(file_finder, console)
738738

739739
# Step 4: Prepare metadata for analysis
740-
target_ecosystems = ", ".join([member.value for member in ecosystems])
741-
wait_msg = WAIT_MSG_ANALYZING_TARGETS.format(target_ecosystems)
740+
if ecosystems:
741+
target_ecosystems = ", ".join([member.value for member in ecosystems])
742+
wait_msg = WAIT_MSG_ANALYZING_TARGETS.format(target_ecosystems)
743+
else:
744+
# Handle the case where no ecosystems are detected
745+
target_ecosystems = "No ecosystems detected"
746+
wait_msg = "Analyzing files and environments for security findings"
742747

743748
# Step 5: Initialize data structures and counters for analysis
744749
files: List[FileModel] = []

0 commit comments

Comments
 (0)