Class: Extension::Command::Check::CheckOptions

Inherits:
ShopifyCLI::Options show all
Defined in:
lib/project_types/extension/commands/check.rb

Instance Attribute Summary

Attributes inherited from ShopifyCLI::Options

#flags, #help, #subcommand

Instance Method Summary collapse

Methods inherited from ShopifyCLI::Options

#parse_flags, #parser

Constructor Details

#initialize(ctx, theme_check) ⇒ CheckOptions

Returns a new instance of CheckOptions.



10
11
12
13
14
# File 'lib/project_types/extension/commands/check.rb', line 10

def initialize(ctx, theme_check)
  super()
  @theme_check = theme_check
  @ctx = ctx
end

Instance Method Details

#parse(_options_block, args) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/project_types/extension/commands/check.rb', line 16

def parse(_options_block, args)
  # Check if .theme-check.yml exists, or if another -C has been passed on the command line
  unless args.include?("-C") || @ctx.file_exist?(".theme-check.yml")
    args += ["-C", ":theme_app_extension"]
  end
  @theme_check.parse(args)
end