Fix updating homebrew dependencies after sharding in core tap

This commit is contained in:
Shivam Mathur 2023-11-07 13:11:56 +05:30
parent 6668249e24
commit 65fad67e88
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -126,7 +126,8 @@ patch_brew() {
# Helper function to update the dependencies.
update_dependencies_helper() {
dependency=$1
get -q -n "$core_repo/Formula/$dependency.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$dependency.rb"
[[ "${dependency:0:3}" = "lib" ]] && prefix=lib || prefix="${dependency:0:1}"
get -q -n "$core_repo/Formula/$prefix/$dependency.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$prefix/$dependency.rb"
link_libraries "$dependency"
}