Method: Jets::Commands::Base.dispatch
- Defined in:
- lib/jets/commands/base.rb
.dispatch(command, given_args, given_opts, config) ⇒ Object
Hacky way to handle error for ‘jets new’ when no project name is passed in to avoid this error:
required arguments 'project_name' (Thor::RequiredArgumentMissingError)
34 35 36 37 38 39 |
# File 'lib/jets/commands/base.rb', line 34 def dispatch(command, given_args, given_opts, config) if given_args.reject{|s| s =~ /^-/} == ['new'] # user forgot to pass a project name given_args = ['help', 'new'] end super end |