Merge pull request #154 from andrew/master

Default the wheneverize commands directory option to .
This commit is contained in:
Javan Makhmali 2011-07-31 11:55:21 -07:00
commit e6015b5f64

View File

@ -17,17 +17,16 @@ OptionParser.new do |opts|
end end
end end
if ARGV.empty? unless ARGV.empty?
abort "Please specify the directory to wheneverize, e.g. `#{File.basename($0)} .'" if !File.exists?(ARGV.first)
elsif !File.exists?(ARGV.first) abort "`#{ARGV.first}' does not exist."
abort "`#{ARGV.first}' does not exist." elsif !File.directory?(ARGV.first)
elsif !File.directory?(ARGV.first) abort "`#{ARGV.first}' is not a directory."
abort "`#{ARGV.first}' is not a directory." elsif ARGV.length > 1
elsif ARGV.length > 1 abort "Too many arguments; please specify only the directory to wheneverize."
abort "Too many arguments; please specify only the directory to wheneverize." end
end end
content = <<-FILE content = <<-FILE
# Use this file to easily define all of your cron jobs. # Use this file to easily define all of your cron jobs.
# #
@ -52,7 +51,7 @@ content = <<-FILE
FILE FILE
file = 'config/schedule.rb' file = 'config/schedule.rb'
base = ARGV.shift base = ARGV.empty? ? '.' : ARGV.shift
file = File.join(base, file) file = File.join(base, file)
if File.exists?(file) if File.exists?(file)