# frozen_string_literal: true require_relative "../base" module Neetob class CLI module Heroku class Base < CLI::Base NEETO_DEPLOY_DOCS = "https://github.com/bigbinary/neetob/#working-with-neetodeploy" def initialize super() @staging_apps = [] end def process(*args) run(*args) show_matching_staging_apps if @staging_apps.present? end private def find_all_matching_apps_or_repos(*args) apps_list = super(*args) @staging_apps, production_apps = apps_list.partition { |app| app.include?("-web-staging") } production_apps end def show_matching_staging_apps ui.info( "\n\nWe have migrated all the staging apps to neetoDeploy. \ \nGiven apps param matches the following app(s) which no longer exist in Heroku:\n\n") @staging_apps.map do |app| ui.info(" - #{app}") end ui.info("\nPlease find the corresponding command for neetodeploy: #{NEETO_DEPLOY_DOCS}") end end end end end