Class: Theme::Command::Check

Inherits:
ShopifyCLI::Command::SubCommand show all
Defined in:
lib/project_types/theme/commands/check.rb

Defined Under Namespace

Classes: Options

Instance Attribute Summary

Attributes inherited from ShopifyCLI::Command

#ctx, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ShopifyCLI::Command::SubCommand

call

Methods inherited from ShopifyCLI::Command

call, call_help, check_node_version, check_ruby_version, check_version, options, prerequisite_task, recommend_default_node_range, recommend_default_ruby_range, recommend_node, recommend_ruby, run_prerequisites, subcommand, subcommand_registry

Methods included from ShopifyCLI::Feature::Set

#hidden?, #hidden_feature

Constructor Details

#initializeCheck

Returns a new instance of Check.



20
21
22
23
24
# File 'lib/project_types/theme/commands/check.rb', line 20

def initialize(*)
  super
  @theme_check = ThemeCheck::Cli.new
  self.options = Options.new(@theme_check)
end

Class Method Details

.helpObject



33
34
35
# File 'lib/project_types/theme/commands/check.rb', line 33

def self.help
  ShopifyCLI::Context.message("theme.check.help", ShopifyCLI::TOOL_NAME)
end

Instance Method Details

#callObject



26
27
28
29
30
31
# File 'lib/project_types/theme/commands/check.rb', line 26

def call(*)
  @theme_check.run!
rescue ThemeCheck::Cli::Abort, ThemeCheck::ThemeCheckError => e
  raise ShopifyCLI::Abort,
    ShopifyCLI::Context.message("theme.check.error", e.full_message)
end