Sha256: 414957c76278943a34aacefbe24ef3af6213c2c41840bf9ed4f53c72eaf13ccc

Contents?: true

Size: 1019 Bytes

Versions: 2

Compression:

Stored size: 1019 Bytes

Contents

#!/usr/bin/env ruby
require 'optparse'
require 'solrsrv'

cmd = %w(java)

OptionParser.new do |opts|

  opts.on '--home DIRECTORY', 'Set solr home directory to DIRECTORY.' do |solr_home|
    cmd << "-Dsolr.solr.home=#{File.expand_path(solr_home)}"
  end

  opts.on '--data-dir DIRECTORY', 'Set solr data directory to DIRECTORY.' do |data_path|
    cmd << "-Dsolr.data.dir=#{File.expand_path(data_path)}"
  end

  opts.on '--pid-file FILENAME', 'Save the pid in DIRECTORY. (default: none)' do |data_path|
    File.open(File.expand_path(data_path), 'w') do |f|
      f.write(Process.pid)
    end
  end

  opts.on '--log-dir DIRECTORY', '' do |log_path|
    cmd << "-Djetty.logs=#{File.expand_path(log_path)}"
  end

  opts.on '--port PORT', 'Set the port number to listen to' do |port|
    cmd << "-Djetty.port=#{port}"
  end

  opts.on_tail('-h', '--help', 'Show extended help message.') do
    puts opts
    exit 0
  end

end.parse! ARGV

cmd << '-jar start.jar'
exec "cd #{Solrsrv::SolrPath} && exec #{cmd.join(' ')}"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solrsrv-1.0.1 bin/solrsrv
solrsrv-1.0.0 bin/solrsrv