Skip to content

Commit f05ff49

Browse files
committed
skip local directory scan when only remote sources are specified
1 parent f1fc55c commit f05ff49

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

cull.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,13 +815,19 @@ def main() -> None:
815815
_tprint(bold(f"━━━ cull: searching for {labels} ━━━"))
816816

817817
all_findings: list[Finding] = []
818+
has_other_source = (
819+
args.github_org or args.docker or args.images
820+
or args.gcr_project or args.gar_repo
821+
)
822+
scan_dirs = args.dirs or (None if has_other_source else ["."])
818823

819824
for target in targets:
820825
pkg, bad_version = target.name, target.version
821826
print_header(f"▸ {target.label}")
822827

823-
print_header(" LOCAL DIRECTORIES")
824-
all_findings.extend(scan_local(args.dirs or ["."], pkg, bad_version))
828+
if scan_dirs:
829+
print_header(" LOCAL DIRECTORIES")
830+
all_findings.extend(scan_local(scan_dirs, pkg, bad_version))
825831

826832
if args.github_token and args.github_org:
827833
print_header(" GITHUB")

0 commit comments

Comments
 (0)