bin/makesure in makesure-0.0.5 vs bin/makesure in makesure-0.0.6
- old
+ new
@@ -4,10 +4,11 @@
require 'makesure'
require 'optparse'
cron_path = '/etc/cron.d/makesure.cron'
+rvm = false
parser = OptionParser.new do |opts|
opts.banner = "Usage: makesure [options] COMMAND"
opts.separator ""
@@ -15,10 +16,14 @@
opts.on("-c", "--cron <path to file>", "Where should makesure put its cron entries? Must be a file that will be loaded by cron") do |path|
cron_path = path
end
+ opts.on("-r", "--[no-]rvm", "Whether or not Makesure should wrap the commands in its cron file for use with RVM") do |r|
+ rvm = r
+ end
+
opts.on("-h", "--help", "Show this message") do
puts opts
exit
end
@@ -26,11 +31,11 @@
opts.separator "Commands:"
opts.separator " init Creates an initial Makesurefile"
opts.separator " update Updates cron with commands scheduled by your system definitions"
end
-parser.parse!
+parser.parse!(ARGV)
case ARGV[0]
when 'init'
dir = File.expand_path(ARGV[1] || '.')
abort "#{dir} is not a directory" unless File.directory?(dir)
@@ -69,9 +74,9 @@
FILE
end
end
when 'update'
Makesure.load_system_defs
- Makesure::Cron.new(:cron_path => cron_path)
+ Makesure::Cron.new(:cron_path => cron_path, :rvm => rvm)
else
puts parser.help
end