81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/tlapse/cli/alpha.rb', line 81
def capture
dirname = Time.now.strftime(Tlapse::Capture.capture_dirname)
FileUtils.mkdir_p dirname
Dir.chdir dirname
cmd = Tlapse::Capture.timelapse_command(
to: parse_time(options[:until]),
interval: options[:interval].minutes
)
if options[:compile]
video = Tlapse::Video.new(
outfile: options[:compile_out]
)
if video.outfile_exists?
Tlapse::Logger.error! "The file #{video.outfile} already exists in" \
" the directory #{dirname}. Please delete it or use the" \
" --compile-out option to specify a different filename."
end
cmd += " && #{video.create_command}"
end
exec cmd
end
|