mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
startup/bootsnap: raise repeated LoadError
.
If `HOMEBREW_BOOTSNAP_RETRY` was set then we should raise the `LoadError` the second time so that the failures are user visible for debugging.
This commit is contained in:
parent
c076a46c19
commit
c55a5e30dd
@ -13,13 +13,13 @@ end
|
|||||||
if homebrew_bootsnap_enabled
|
if homebrew_bootsnap_enabled
|
||||||
begin
|
begin
|
||||||
require "bootsnap"
|
require "bootsnap"
|
||||||
rescue LoadError
|
rescue LoadError => e
|
||||||
unless ENV["HOMEBREW_BOOTSNAP_RETRY"]
|
raise e if ENV["HOMEBREW_BOOTSNAP_RETRY"]
|
||||||
Homebrew.install_bundler_gems!(groups: ["bootsnap"], only_warn_on_failure: true)
|
|
||||||
|
|
||||||
ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1"
|
Homebrew.install_bundler_gems!(groups: ["bootsnap"], only_warn_on_failure: true)
|
||||||
exec ENV.fetch("HOMEBREW_BREW_FILE"), *ARGV
|
|
||||||
end
|
ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1"
|
||||||
|
exec ENV.fetch("HOMEBREW_BREW_FILE"), *ARGV
|
||||||
end
|
end
|
||||||
|
|
||||||
ENV.delete("HOMEBREW_BOOTSNAP_RETRY")
|
ENV.delete("HOMEBREW_BOOTSNAP_RETRY")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user