mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[bundler/bundler] Require relatively from exe/ when possible
https://github.com/bundler/bundler/commit/e4cbb91b7d
This commit is contained in:
parent
998204882b
commit
c50c2354cf
1 changed files with 19 additions and 3 deletions
|
@ -7,7 +7,14 @@ Signal.trap("INT") do
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
require "bundler"
|
base_path = File.expand_path("../lib", __dir__)
|
||||||
|
|
||||||
|
if File.exist?(base_path)
|
||||||
|
require_relative "../lib/bundler"
|
||||||
|
else
|
||||||
|
require "bundler"
|
||||||
|
end
|
||||||
|
|
||||||
# Check if an older version of bundler is installed
|
# Check if an older version of bundler is installed
|
||||||
$LOAD_PATH.each do |path|
|
$LOAD_PATH.each do |path|
|
||||||
next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9
|
next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9
|
||||||
|
@ -18,9 +25,18 @@ $LOAD_PATH.each do |path|
|
||||||
abort(err)
|
abort(err)
|
||||||
end
|
end
|
||||||
|
|
||||||
require "bundler/friendly_errors"
|
if File.exist?(base_path)
|
||||||
|
require_relative "../lib/bundler/friendly_errors"
|
||||||
|
else
|
||||||
|
require "bundler/friendly_errors"
|
||||||
|
end
|
||||||
|
|
||||||
Bundler.with_friendly_errors do
|
Bundler.with_friendly_errors do
|
||||||
require "bundler/cli"
|
if File.exist?(base_path)
|
||||||
|
require_relative "../lib/bundler/cli"
|
||||||
|
else
|
||||||
|
require "bundler/cli"
|
||||||
|
end
|
||||||
|
|
||||||
# Allow any command to use --help flag to show help for that command
|
# Allow any command to use --help flag to show help for that command
|
||||||
help_flags = %w[--help -h]
|
help_flags = %w[--help -h]
|
||||||
|
|
Loading…
Add table
Reference in a new issue