summaryrefslogtreecommitdiff
path: root/libexec/bundle
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/bundle')
-rwxr-xr-xlibexec/bundle29
1 files changed, 29 insertions, 0 deletions
diff --git a/libexec/bundle b/libexec/bundle
new file mode 100755
index 0000000000..92387bc2cf
--- /dev/null
+++ b/libexec/bundle
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+# Exit cleanly from an early interrupt
+Signal.trap("INT") do
+ Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
+ exit 1
+end
+
+base_path = File.expand_path("../lib", __dir__)
+
+if File.exist?(base_path)
+ $LOAD_PATH.unshift(base_path)
+end
+
+require "bundler"
+
+require "bundler/friendly_errors"
+
+Bundler.with_friendly_errors do
+ require "bundler/cli"
+
+ # Allow any command to use --help flag to show help for that command
+ help_flags = %w[--help -h]
+ help_flag_used = ARGV.any? {|a| help_flags.include? a }
+ args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
+
+ Bundler::CLI.start(args, debug: true)
+end