Class: ShopifyCLI::Commands::Config::Feature
- Inherits:
-
ShopifyCLI::Command::SubCommand
- Object
- CLI::Kit::BaseCommand
- ShopifyCLI::Command
- 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 ShopifyCLI::Command::SubCommand
Methods inherited from ShopifyCLI::Command
call, call_help, 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
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 |