Skip to content

Commit

Permalink
Default wheneverize directory to '.'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jul 11, 2011
1 parent 42061be commit f21f48a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions bin/wheneverize
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ OptionParser.new do |opts|
end
end

if ARGV.empty?
abort "Please specify the directory to wheneverize, e.g. `#{File.basename($0)} .'"
elsif !File.exists?(ARGV.first)
abort "`#{ARGV.first}' does not exist."
elsif !File.directory?(ARGV.first)
abort "`#{ARGV.first}' is not a directory."
elsif ARGV.length > 1
abort "Too many arguments; please specify only the directory to wheneverize."
unless ARGV.empty?
if !File.exists?(ARGV.first)
abort "`#{ARGV.first}' does not exist."
elsif !File.directory?(ARGV.first)
abort "`#{ARGV.first}' is not a directory."
elsif ARGV.length > 1
abort "Too many arguments; please specify only the directory to wheneverize."
end
end


content = <<-FILE
# Use this file to easily define all of your cron jobs.
#
Expand All @@ -52,7 +51,7 @@ content = <<-FILE
FILE

file = 'config/schedule.rb'
base = ARGV.shift
base = ARGV.empty? ? '.' : ARGV.shift

file = File.join(base, file)
if File.exists?(file)
Expand Down

0 comments on commit f21f48a

Please sign in to comment.