From 8221d93386dcdb2f3d942c0ee0956df39109c3f7 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Thu, 22 Mar 2007 09:40:04 +0000 Subject: [PATCH] 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 --- client/ruby/solr-ruby/Rakefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/ruby/solr-ruby/Rakefile b/client/ruby/solr-ruby/Rakefile index be6773bb49e..0a0046cbf1c 100644 --- a/client/ruby/solr-ruby/Rakefile +++ b/client/ruby/solr-ruby/Rakefile @@ -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