Module: Strata::CLI::Guard

Constant Summary collapse

ALLOWED_COMMANDS =
%w[
  init
  help
  adapters
  version
  deploy
].freeze

Instance Method Summary collapse

Instance Method Details

#invoke_command(command, *args) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/strata/cli/guard.rb', line 15

def invoke_command(command, *args)
  Utils.exit_error_if_not_strata! unless ALLOWED_COMMANDS.include?(command.name)
  super
rescue Strata::CommandError => e
  shell.say_error "ERROR: #{e.message}", :red
  exit 1
end