Use Homebrew for PHP 7.4 on macOS

This commit is contained in:
Shivam Mathur
2019-11-30 03:29:00 +05:30
parent 5a081357b4
commit 2f951ef5cd
4 changed files with 10 additions and 48 deletions

View File

@ -17,12 +17,15 @@ add_log() {
fi
}
step_log "Setup PHP and Composer"
version=$1
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
if [ "$1" = "5.6" ] || [ "$1" = "7.0" ]; then
brew tap exolnet/homebrew-deprecated >/dev/null 2>&1
fi
step_log "Setup PHP and Composer"
if [ "$1" = "7.4" ]; then
brew update >/dev/null 2>&1
fi
brew install php@"$1" composer >/dev/null 2>&1
brew link --force --overwrite php@"$1" >/dev/null 2>&1
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")

View File

@ -173,32 +173,10 @@ export async function readScript(
version: string,
os_version: string
): Promise<string> {
switch (os_version) {
case 'darwin':
switch (version) {
case '7.4':
return fs.readFileSync(
path.join(__dirname, '../src/scripts/7.4.sh'),
'utf8'
);
}
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
case 'linux':
case 'win32':
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
default:
return await log(
'Platform ' + os_version + ' is not supported',
os_version,
'error'
);
}
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
}
/**