Class: WpFire::CreateCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/wp_fire/main_command.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/wp_fire/main_command.rb', line 80

def execute
  if template and !template.eql?""
    raise ArgumentError, "Error! --template-path is required because you have specified --template" if template_path.nil?
  end
  if template_path and !File.directory? template_path
    raise ArgumentError, "Error! template-path not found."
  end
  name = @name.gsub(/\W/, '_')

  thor_actions = ThorUtils.new
  generator = WpFire::Generator.new(name, thor_actions, generate_config)
  generator.create_structure
  generator.write_config
  generator.copy_javascript
  generator.copy_stylesheets
  generator.copy_functions
  generator.copy_templates
end