-
Notifications
You must be signed in to change notification settings - Fork 779
/
veewee
executable file
·58 lines (43 loc) · 1.19 KB
/
veewee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'bundler'
require 'virtualbox'
require 'veewee'
class VeeweeCLI < Thor
desc "define [NAME] [TEMPLATE]", "initializes a box from a template"
method_options :force => :boolean
def define(box_name=nil, template=nil)
if (box_name.nil?)
puts "please provide a box_name"
exit
end
puts "Init a new box #{box_name}, starting from template #{template}"
Veewee::Environment.define(box_name,template)
end
desc "templates", "list the template available"
def templates
Veewee::Environment.list_templates
end
desc "build [NAME]", "build the box defined"
method_options :force => :boolean
def build(box_name)
puts "Building box #{box_name}"
vs=Veewee::Environment.new(options)
vd=vs.get_definition(box_name)
vs.build(box_name,vd)
end
desc "export [NAME]", "export the box"
method_options :force => :boolean
def export(box_name)
if (!box_name.nil?)
Veewee::Environment.export_box(box_name)
end
end
end
version=VirtualBox.version
if (version.match(/^4./))
VeeweeCLI.start
else
puts "veewee only supports VirtualBox 4.x"
end