mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
git: check homebrew/core existence before installing brewed git
This commit is contained in:
parent
deea4c82a4
commit
5560f5550d
@ -258,7 +258,8 @@ EOS
|
|||||||
|
|
||||||
if ! git --version >/dev/null 2>&1
|
if ! git --version >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
brew install git
|
# we cannot install brewed git if homebrew/core is unavailable.
|
||||||
|
[[ -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] && brew install git
|
||||||
if ! git --version >/dev/null 2>&1
|
if ! git --version >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
odie "Git must be installed and in your PATH!"
|
odie "Git must be installed and in your PATH!"
|
||||||
|
@ -7,6 +7,11 @@ module Utils
|
|||||||
def self.ensure_git_installed!
|
def self.ensure_git_installed!
|
||||||
return if git_available?
|
return if git_available?
|
||||||
|
|
||||||
|
# we cannot install brewed git if homebrew/core is unavailable.
|
||||||
|
unless CoreTap.instance.installed?
|
||||||
|
raise "Git is unavailable"
|
||||||
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
oh1 "Installing git"
|
oh1 "Installing git"
|
||||||
safe_system HOMEBREW_BREW_FILE, "install", "git"
|
safe_system HOMEBREW_BREW_FILE, "install", "git"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user