Class: Octopress::Ink::Commands::Copy

Inherits:
Object
  • Object
show all
Defined in:
lib/octopress-ink/commands/copy.rb

Class Method Summary collapse

Class Method Details

.process_command(p) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/octopress-ink/commands/copy.rb', line 5

def self.process_command(p)
  p.command(:copy) do |c|
    c.syntax "copy <PLUGIN> [options]"
    c.description "Copy plugin assets to _plugins/PLUGIN/."
    c.option "all", "--all", "Copy all plugin assets."
    c.option "force", "--force", "Overwrite files."
    c.option "path", "--path PATH", "Copy plugin assets to an alternate path."
    CommandHelpers.add_asset_options(c, 'Copy')

    c.action do |args, options|
      if args.empty?
        puts "Error: Please pass a plugin slug to install assets from that plugin."
        Octopress::Ink.list_plugins
      else
        name = args[0]
        Octopress::Ink.copy_plugin_assets(name, options)
      end
    end
  end
end