Class: FluidCLI::Commands::Theme::Init

Inherits:
FluidCLI::Command show all
Defined in:
lib/fluid_cli/commands/theme/init.rb

Constant Summary collapse

DEFAULT_CLONE_URL =
"[email protected]:fluid-commerce/base-theme.git"

Instance Attribute Summary

Attributes inherited from FluidCLI::Command

#ctx, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FluidCLI::Command

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

Constructor Details

This class inherits a constructor from FluidCLI::Command

Class Method Details

.helpObject



21
22
23
# File 'lib/fluid_cli/commands/theme/init.rb', line 21

def self.help
  "Initialize a new theme by cloning the base theme."
end

Instance Method Details

#call(args, _name) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/fluid_cli/commands/theme/init.rb', line 13

def call(args, _name)
  name = args.first || ask_name
  clone_url = options.flags[:clone_url] || DEFAULT_CLONE_URL
  puts "Cloning theme from #{clone_url} into #{name}..."

  clone(clone_url, name)
end