Class: ShopifyCli::Commands::Config::Feature
- Inherits:
-
SubCommand
- Object
- CLI::Kit::BaseCommand
- ShopifyCli::Command
- SubCommand
- ShopifyCli::Commands::Config::Feature
- Defined in:
- lib/shopify-cli/commands/config.rb
Instance Attribute Summary
Attributes inherited from ShopifyCli::Command
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from SubCommand
Methods inherited from ShopifyCli::Command
call, call_help, #initialize, options, prerequisite_task, run_prerequisites, subcommand, subcommand_registry
Methods included from Feature::Set
Constructor Details
This class inherits a constructor from ShopifyCli::Command
Class Method Details
.help ⇒ Object
20 21 22 |
# File 'lib/shopify-cli/commands/config.rb', line 20 def self.help ShopifyCli::Context.('core.config.feature.help', ShopifyCli::TOOL_NAME) end |
Instance Method Details
#call(args, _name) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/shopify-cli/commands/config.rb', line 30 def call(args, _name) feature_name = args.shift return @ctx.puts(@ctx.('core.config.help', ShopifyCli::TOOL_NAME)) if feature_name.nil? is_enabled = ShopifyCli::Feature.enabled?(feature_name) if .flags[:action] == 'disable' && is_enabled ShopifyCli::Feature.disable(feature_name) @ctx.puts(@ctx.('core.config.feature.disabled', feature_name)) elsif .flags[:action] == 'enable' && !is_enabled ShopifyCli::Feature.enable(feature_name) @ctx.puts(@ctx.('core.config.feature.enabled', feature_name)) elsif is_enabled @ctx.puts(@ctx.('core.config.feature.is_enabled', feature_name)) else @ctx.puts(@ctx.('core.config.feature.is_disabled', feature_name)) end end |