-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex_new_file.rb
executable file
·37 lines (28 loc) · 1.04 KB
/
index_new_file.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env ruby
# Before doing anything else, need to
# force bundler to load up so we
# can require gems from the Gemfile
#
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "bundler/setup"
# Add the local lib
$LOAD_PATH.unshift (Pathname(__dir__).parent + 'lib').to_s
$LOAD_PATH.unshift (Pathname(__dir__).parent + 'indexer').to_s
# Now we can actually load stuff
require 'hanami/cli'
require "dromedary/services"
require "med_installer/indexing_steps"
filename = ARGV.shift
indexer = MedInstaller::IndexingSteps.new(zipfile: filename)
indexer.index