lib/neetob/cli/base.rb in neetob-0.4.9 vs lib/neetob/cli/base.rb in neetob-0.4.10

- old
+ new

@@ -20,22 +20,37 @@ private def find_all_matching_apps_or_repos(apps, platform_name, sandbox_mode, quiet = false) all_neeto_repos = apps == ["all"] inform_about_current_working_mode(sandbox_mode, quiet) + all_available_apps = sandbox_mode ? testing_apps(platform_name) : build_app_list_from_neeto_compliance(platform_name, all_neeto_repos) - matching_apps = all_neeto_repos ? all_available_apps : match_apps(apps || ["*"], all_available_apps) + + matching_apps = if apps == ["all"] + all_available_apps + elsif apps == ["engines"] + all_engine_repos(sandbox_mode) + else + match_apps(apps || ["*"], all_available_apps) + end + if matching_apps.length == 0 error_msg = sandbox_mode ? "Only \"neeto-dummy\" app is available for sandbox mode. Remove the \"--sandbox\" flag to run the given command for all the neeto applications." : "No matching app is found in the neeto apps list maintained at \"#{NEETO_APPS_LIST_LINK}\"" ui.error(error_msg) exit end matching_apps + end + + def all_engine_repos(sandbox_mode) + sandbox_mode ? + testing_apps(:github) : + NeetoCompliance::NeetoRepos.nanos_backend end def match_apps(required_apps, available_apps) apps = required_apps&.map { |app| Regexp.new "#{app.gsub("*", "[-a-zA-Z0-9]*")}" } available_apps.select do |available_app|