Unrefactor broken tap
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
c7bbb904e8
commit
1cf8b43966
@ -147,25 +147,23 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def broken_tap_msg(tap)
|
|
||||||
<<~EOS
|
|
||||||
#{tap.full_name} was not tapped properly.
|
|
||||||
To fix:
|
|
||||||
rm -rf "#{tap.path}"
|
|
||||||
brew tap #{tap.name}
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
def broken_tap(tap)
|
def broken_tap(tap)
|
||||||
return unless Utils::Git.available?
|
return unless Utils::Git.available?
|
||||||
return unless HOMEBREW_REPOSITORY.git?
|
return unless HOMEBREW_REPOSITORY.git?
|
||||||
|
|
||||||
return broken_tap_msg(tap) if tap.remote.blank?
|
message = <<~EOS
|
||||||
|
#{tap.full_name} was not tapped properly! Run:
|
||||||
|
rm -rf "#{tap.path}"
|
||||||
|
brew tap #{tap.name}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
return message if tap.remote.blank?
|
||||||
|
|
||||||
tap_head = tap.git_head
|
tap_head = tap.git_head
|
||||||
return broken_tap_msg(tap) if tap_head.blank?
|
return message if tap_head.blank?
|
||||||
|
return if tap_head != HOMEBREW_REPOSITORY.git_head
|
||||||
|
|
||||||
return broken_tap_msg(tap) if tap_head == HOMEBREW_REPOSITORY.git_head
|
message
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_for_installed_developer_tools
|
def check_for_installed_developer_tools
|
||||||
|
Loading…
x
Reference in New Issue
Block a user