brew/Library/Homebrew/load_path.rb
Mike McQuaid dad1939142
Fix HOMEBREW_BOOTSNAP setup
- rename to `homebrew_bootsnap.rb` to avoid conflicting with the
  `bootsnap.rb` we need to `require`
- if the `require` fails: run bundler (until we vendor this gem)
2021-01-21 17:35:13 +00:00

18 lines
345 B
Ruby

# typed: true
# frozen_string_literal: true
require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath.freeze
$LOAD_PATH.push HOMEBREW_LIBRARY_PATH.to_s
require "vendor/bundle/bundler/setup"
if ENV["HOMEBREW_BOOTSNAP"]
require "homebrew_bootsnap"
else
$LOAD_PATH.select! { |d| Pathname(d).directory? }
$LOAD_PATH.uniq!
end