Class: Script::Commands::Disable

Inherits:
ShopifyCli::Command show all
Defined in:
lib/project_types/script/commands/disable.rb

Instance Attribute Summary

Attributes inherited from ShopifyCli::Command

#ctx, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ShopifyCli::Command

call, call_help, #initialize, options, prerequisite_task, run_prerequisites, subcommand, subcommand_registry

Methods included from ShopifyCli::Feature::Set

#hidden?, #hidden_feature

Constructor Details

This class inherits a constructor from ShopifyCli::Command

Class Method Details

.helpObject



20
21
22
# File 'lib/project_types/script/commands/disable.rb', line 20

def self.help
  ShopifyCli::Context.message('script.disable.help', ShopifyCli::TOOL_NAME)
end

Instance Method Details

#call(_args, _name) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/project_types/script/commands/disable.rb', line 6

def call(_args, _name)
  ShopifyCli::Tasks::EnsureEnv.call(@ctx, required: [:api_key, :secret, :shop])
  project = ScriptProject.current
  Layers::Application::DisableScript.call(
    ctx: @ctx,
    api_key: project.env[:api_key],
    shop_domain: project.env[:shop],
    extension_point_type: project.extension_point_type
  )
  @ctx.puts(@ctx.message('script.disable.script_disabled'))
rescue StandardError => e
  UI::ErrorHandler.pretty_print_and_raise(e, failed_op: @ctx.message('script.disable.error.operation_failed'))
end