diff --git a/cycode/cli/apps/scan/scan_command.py b/cycode/cli/apps/scan/scan_command.py index 9b6f9e8b..dda94876 100644 --- a/cycode/cli/apps/scan/scan_command.py +++ b/cycode/cli/apps/scan/scan_command.py @@ -155,6 +155,8 @@ def scan_command( ctx.obj['monitor'] = monitor ctx.obj['maven_settings_file'] = maven_settings_file ctx.obj['report'] = report + ctx.obj['gradle_all_sub_projects'] = gradle_all_sub_projects + ctx.obj['no_restore'] = no_restore scan_client = get_scan_cycode_client(ctx) ctx.obj['client'] = scan_client @@ -167,8 +169,6 @@ def scan_command( console_printer = ctx.obj['console_printer'] console_printer.enable_recording(export_type, export_file) - _ = no_restore, gradle_all_sub_projects # they are actually used; via ctx.params - _sca_scan_to_context(ctx, sca_scan) diff --git a/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py b/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py index ed9494ad..50830243 100644 --- a/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py +++ b/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py @@ -27,7 +27,7 @@ def __init__( self.projects = self.get_all_projects() if self.is_gradle_sub_projects() else projects def is_gradle_sub_projects(self) -> bool: - return self.ctx.params.get('gradle_all_sub_projects', False) + return self.ctx.obj.get('gradle_all_sub_projects', False) def is_project(self, document: Document) -> bool: return document.path.endswith(BUILD_GRADLE_FILE_NAME) or document.path.endswith(BUILD_GRADLE_KTS_FILE_NAME) diff --git a/cycode/cli/files_collector/sca/sca_file_collector.py b/cycode/cli/files_collector/sca/sca_file_collector.py index 35ee36c7..84b088b2 100644 --- a/cycode/cli/files_collector/sca/sca_file_collector.py +++ b/cycode/cli/files_collector/sca/sca_file_collector.py @@ -165,6 +165,6 @@ def _add_dependencies_tree_documents( def add_sca_dependencies_tree_documents_if_needed( ctx: typer.Context, scan_type: str, documents_to_scan: list[Document], is_git_diff: bool = False ) -> None: - no_restore = ctx.params.get('no_restore', False) + no_restore = ctx.obj.get('no_restore', False) if scan_type == consts.SCA_SCAN_TYPE and not no_restore: _add_dependencies_tree_documents(ctx, documents_to_scan, is_git_diff)