Fetch formulae before setup

This commit is contained in:
Shivam Mathur 2020-04-23 14:00:57 +05:30
parent 9385896f2a
commit 277239149a
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -148,12 +148,25 @@ add_pecl() {
add_log "$tick" "PECL" "Added" add_log "$tick" "PECL" "Added"
} }
# Function to fetch updated formulas
update_formulae() {
brew_dir=$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
for formula in httpd pkg-config apr apr-util argon2 aspell autoconf bison curl-openssl freetds freetype gettext glib gmp icu4c jpeg krb5 libffi libpng libpq libsodium libzip oniguruma openldap openssl@1.1 re2c sqlite tidyp unixodbc webp; do
sudo curl -o "$brew_dir"/"$formula".rb -sSL https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/"$formula".rb &
to_wait+=( $! )
done
wait "${to_wait[@]}"
}
# Function to setup PHP and composer # Function to setup PHP and composer
setup_php_and_composer() { setup_php() {
if [ "$version" = "8.0" ]; then
update_formulae
fi
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
brew tap shivammathur/homebrew-php >/dev/null 2>&1 brew tap shivammathur/homebrew-php
brew install shivammathur/php/php@"$version" >/dev/null 2>&1 brew install shivammathur/php/php@"$version"
brew link --force --overwrite php@"$version" >/dev/null 2>&1 brew link --force --overwrite php@"$version"
} }
# Variables # Variables
@ -166,10 +179,7 @@ existing_version=$(php-config --version | cut -c 1-3)
# Setup PHP # Setup PHP
step_log "Setup PHP" step_log "Setup PHP"
if [ "$existing_version" != "$version" ]; then if [ "$existing_version" != "$version" ]; then
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE >/dev/null 2>&1 setup_php >/dev/null 2>&1
brew tap shivammathur/homebrew-php >/dev/null 2>&1
brew install shivammathur/php/php@"$version" >/dev/null 2>&1
brew link --force --overwrite php@"$version" >/dev/null 2>&1
status="Installed" status="Installed"
else else
status="Found" status="Found"