Skip to content

Commit

Permalink
don't build jruby when the directory is alredy present
Browse files Browse the repository at this point in the history
  • Loading branch information
calavera committed May 13, 2010
1 parent c60cc23 commit 1973ac5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ def prepare_rubygems
end

def cleanup

[MACDIST, GEMSDIST, 'pkg' ].each do |f|
rm_r f if File.exist? f
end

exit
end

Expand All @@ -80,13 +79,18 @@ def exec_and_cleanup(cmd)

puts "- Preparing JRuby distribution"

cd HOME do
if ! File.exist? File.join(DIST, "jruby-bin-#{JVERSION}.zip")
exec_and_cleanup "ant clean dist"
dist_directory = File.join(DIST, "jruby-#{JVERSION}")
if !File.exist?(dist_directory) || !File.directory?(dist_directory)
cd HOME do
if ! File.exist? File.join(DIST, "jruby-bin-#{JVERSION}.zip")
exec_and_cleanup "ant clean dist"
end
end
end

exec_and_cleanup "unzip #{DIST}/jruby-bin-#{JVERSION}.zip -d ."
exec_and_cleanup "unzip #{DIST}/jruby-bin-#{JVERSION}.zip -d ."
else
mv dist_directory, "jruby-#{JVERSION}"
end

mv "jruby-#{JVERSION}", MACDIST

Expand Down

0 comments on commit 1973ac5

Please sign in to comment.