aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/vendor/bundler/bin/gem_bundler
blob: 7a8771efeead4d330d236c2a16d2ff5151d23a1c (plain) (blame)
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
38
39
40
#!/usr/bin/env ruby
require "optparse"
require "bundler"

options = {}

parser = OptionParser.new do |op|
  op.banner = "Usage: gem_bundler [OPTIONS] [PATH]"

  op.on("-m", "--manifest MANIFEST") do |manifest|
    options[:manifest] = manifest
  end

  op.on_tail("-h", "--help", "Show this message") do
    puts op
    exit
  end
end
parser.parse!

options[:path] = ARGV.shift

unless options[:path]
  puts parser
  puts %(
    [PATH] must be specified
  )
  exit
end

unless options[:manifest] && File.exist?(options[:manifest])
  puts parser
  puts %(
    MANIFEST must be a valid manifest file
  )
  exit
end


Bundler.run(options)