Module: Strata::CLI::Guard

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#invoke_command(command, *args) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/strata/cli/guard.rb', line 18

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