bin/hudson in hudson-0.2.3 vs bin/hudson in hudson-0.2.4

- old
+ new

@@ -4,16 +4,17 @@ require 'optparse' options = { :port => 3001, - :control => 3002 + :control => 3002, + :home => File.join(ENV['HOME'], '.hudson') } args = ARGV.dup opts = OptionParser.new do |opts| - opts.banner = "Usage: hudson [options] HUDSON_HOME" + opts.banner = "Usage: hudson [options] [HUDSON_HOME]" opts.on("-d", "--daemon", "fork into background and run as daemon") do options[:daemon] = true end @@ -42,14 +43,10 @@ exit end end opts.parse!(args) -unless dir = args.shift - puts "hudson: no directory specified to house hudson" - puts opts - exit(1) -end +dir = args.shift || options[:home] FileUtils.mkdir_p dir FileUtils.cp_r Hudson::PLUGINS, dir ENV['HUDSON_HOME'] = dir cmd = ["java", "-jar", Hudson::WAR] cmd << "--httpPort=#{options[:port]}"