lib/neetob/cli/sre/check_essential_env.rb in neetob-0.4.36 vs lib/neetob/cli/sre/check_essential_env.rb in neetob-0.4.37

- old
+ new

@@ -15,29 +15,32 @@ "HONEYBADGER_JS_API_KEY", "NODE_MODULES_CACHE", "YARN_CACHE", "YARN_PRODUCTION" ] - REQUIRED_KEYS_HEROKU = [ "HEROKU_APP_NAME" ] - REQUIRED_KEYS_NEETODEPLOY = [ - "NODE_OPTIONS", "NEETODEPLOY_APP_NAME" ] + attr_reader :app - def initialize + def initialize(app = nil) super() + @app = app end def run - APPS_LIST[:heroku].each do |app| - check_envs_heroku(app) - end - APPS_LIST[:neetodeploy].each do |app| - check_envs_neetodeploy(app) + if app.nil? + APPS_LIST[:heroku].each do |app| + check_envs_heroku(app) + end + APPS_LIST[:neetodeploy].each do |app| + check_envs_neetodeploy(app) + end + else + is_heroku(app) ? check_envs_heroku(app) : check_envs_neetodeploy(app) end end private