6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/vagrant-screenshot/screenshot_command.rb', line 6
def execute
options = {}
filenames = []
opts = build_screenshot_options options
argv = parse_options(opts)
return if !argv
vm_name = argv[0]
with_target_vms(vm_name) do |vm|
if vm.state != :running
notify :warn, "Skiping #{vm.name}. VM not running"
else
notify :info, "Taking screenshot for #{vm.name}"
filename = create_output_filename vm.name
take_screenshot vm, filename
filenames << filename
open_generated_files(filenames) if options[:open]
end
end
end
|