Fetch homebrew taps manually

This commit is contained in:
Shivam Mathur 2020-12-14 16:42:15 +05:30
parent ea8be20255
commit 569522d50d
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -43,8 +43,15 @@ add_pecl_extension() {
add_brew_tap() { add_brew_tap() {
tap=$1 tap=$1
if ! [ -d "$tap_dir/$tap" ]; then if ! [ -d "$tap_dir/$tap" ]; then
tap_user=$(dirname "$tap")
tap_name=$(basename "$tap")
get -s -n "" "https://github.com/$tap/archive/master.tar.gz" | tar -xzf - -C "$tap_dir/$tap_user" >/dev/null 2>&1
if [ -d "$tap_dir/$tap_user/$tap_name-master" ]; then
sudo mv "$tap_dir/$tap_user/$tap_name-master" "$tap_dir/$tap_user/$tap_name"
else
brew tap --shallow "$tap" >/dev/null 2>&1 brew tap --shallow "$tap" >/dev/null 2>&1
fi fi
fi
} }
# Function to install a php extension from shivammathur/extensions tap. # Function to install a php extension from shivammathur/extensions tap.