Class: ShopifyCLI::Command::AppSubCommand

Inherits:
SubCommand show all
Defined in:
lib/shopify_cli/command/app_sub_command.rb

Instance Attribute Summary

Attributes inherited from ShopifyCLI::Command

#ctx, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SubCommand

call

Methods inherited from ShopifyCLI::Command

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

Methods included from Feature::Set

#hidden?, #hidden_feature

Constructor Details

This class inherits a constructor from ShopifyCLI::Command

Class Method Details

.call_helpObject



15
16
17
18
19
20
21
22
# File 'lib/shopify_cli/command/app_sub_command.rb', line 15

def call_help(*)
  output = help
  if respond_to?(:extended_help)
    output += "\n"
    output += extended_help
  end
  @ctx.puts(output)
end

Instance Method Details

#detect_app(directory: Dir.pwd) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/shopify_cli/command/app_sub_command.rb', line 4

def detect_app(directory: Dir.pwd)
  AppTypeDetector.detect(project_directory: directory)
rescue ShopifyCLI::AppTypeDetector::TypeNotFoundError
  raise ShopifyCLI::Abort, @ctx.message("core.app.error.type_not_found", directory)
rescue ShopifyCLI::AppTypeDetector::MissingShopifyCLIYamlError
  raise ShopifyCLI::Abort, @ctx.message("core.app.error.missing_shopify_cli_yml", directory)
rescue ShopifyCLI::AppTypeDetector::InvalidTypeError => error
  raise ShopifyCLI::Abort, @ctx.message("core.app.error.invalid_project_type", error.project_type)
end