Debian Codegraph @

libexec/bundle

raw
1 #!/usr/bin/env ruby
2 # frozen_string_literal: true
3
4 # Exit cleanly from an early interrupt
5 Signal.trap("INT") do
6 Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
7 exit 1
8 end
9
10 base_path = File.expand_path("../lib", __dir__)
11
12 if File.exist?(base_path)
13 $LOAD_PATH.unshift(base_path)
14 end
15
16 require "bundler"
17
18 require "bundler/friendly_errors"
19
20 Bundler.with_friendly_errors do
21 require "bundler/cli"
22
23 # Allow any command to use --help flag to show help for that command
24 help_flags = %w[--help -h]
25 help_flag_used = ARGV.any? {|a| help_flags.include? a }
26 args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
27
28 Bundler::CLI.start(args, debug: true)
29 end