Class: Vines::Web::Command::Install

Inherits:
Object
  • Object
show all
Defined in:
lib/vines/web/command/install.rb

Instance Method Summary collapse

Instance Method Details

#run(opts) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/vines/web/command/install.rb', line 5

def run(opts)
  raise 'vines-web install <dir>' unless opts[:args].size == 1

  dir = opts[:args].first.downcase
  dir = File.expand_path(dir)
  Dir.mkdir(dir) unless File.exists?(dir)

  web = File.expand_path("../../../../../public", __FILE__)
  FileUtils.cp_r(Dir.glob("#{web}/*"), dir)
  puts "Web assets installed: #{dir}"
end