Fix install_solr_ruby so duplicate subdirectory is not created on subsequent runs

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@521173 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2007-03-22 09:40:04 +00:00
parent dd7864ac11
commit 8221d93386
1 changed files with 6 additions and 5 deletions

View File

@ -95,7 +95,8 @@ namespace :rails do
desc "Install the Rails plugin version into the vendor/plugins dir. Need to set PLUGINS_DIR environment variable."
task :install_solr_ruby => :package do
plugins_dir = ENV["PLUGINS_DIR"] or raise "You must set PLUGINS_DIR"
File.cp_r(File.join("pkg","rails", "solr-ruby-rails-#{SOLR_RUBY_VERSION}/"), File.join(plugins_dir, "solr-ruby-rails-#{SOLR_RUBY_VERSION}/"))
mkdir File.join(plugins_dir, "solr-ruby-rails-#{SOLR_RUBY_VERSION}/") rescue nil
File.cp_r(File.join("pkg","rails", "solr-ruby-rails-#{SOLR_RUBY_VERSION}/"), plugins_dir)
end
end
@ -160,10 +161,10 @@ def egrep(pattern)
count = 0
open(fn) do |f|
while line = f.gets
count += 1
if line =~ pattern
puts "#{fn}:#{count}:#{line}"
end
count += 1
if line =~ pattern
puts "#{fn}:#{count}:#{line}"
end
end
end
end