Compare commits

...

3 Commits

3 changed files with 7 additions and 6 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -59,10 +59,10 @@ export async function setEnv(): Promise<void> {
* Run the script
*/
export async function run(): Promise<void> {
await setEnv();
const os: string = process.platform;
const tool = await utils.scriptTool(os);
const run_path = await getScript(os);
await setEnv();
await exec(tool + run_path);
}

View File

@ -11,13 +11,14 @@ install_icu() {
# Function to add ext-intl with the given version of ICU
add_intl() {
icu=$(echo "$1" | cut -d'-' -f 2)
supported_version=$(get -s -n "" https://api.github.com/repos/shivammathur/icu-intl/releases | grep -Po "${icu//./\\.}" | head -n 1)
if [ "$icu" != "$supported_version" ]; then
add_log "${cross:?}" "intl" "ICU $icu is not supported"
supported_version=$(get -s -n "" https://api.github.com/repos/shivammathur/icu-intl/releases/tags/intl-"$icu" | grep -Po "php${version?}-intl-$icu" | head -n 1)
[ -z "$supported_version" ] && supported_version=$(get -s -n "" https://github.com/shivammathur/icu-intl/releases/expanded_assets/intl-"$icu" | grep -Po "php$version-intl-$icu" | head -n 1)
if [ "php$version-intl-$icu" != "$supported_version" ]; then
add_log "${cross:?}" "intl" "ICU $icu is not supported for PHP $version"
else
[ "${ts:?}" = 'zts' ] && suffix='-zts'
install_icu "$icu" >/dev/null 2>&1
get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix$arch_suffix.so"
get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl-$icu/php${version:?}-intl-$icu$suffix$arch_suffix.so"
enable_extension intl extension
add_extension_log intl "Installed and enabled with ICU $icu"
fi