mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-03 19:34:10 +07:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
96d7cf331d | |||
baed2d33b8 | |||
1398cb4c9f | |||
462e7103e4 | |||
8582cb12d5 |
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -200,7 +200,11 @@ add_tool() {
|
||||
elif [ -e /tmp/"$tool" ]; then
|
||||
sudo cp -a /tmp/"$tool" "$tool_path"
|
||||
fi
|
||||
add_log "$cross" "$tool" "Could not setup $tool"
|
||||
if [ "$status_code" = "404" ]; then
|
||||
add_log "$cross" "$tool" "Failed to download $tool from ${url[*]}"
|
||||
else
|
||||
add_log "$cross" "$tool" "Could not setup $tool"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ get() {
|
||||
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
|
||||
[ "$status_code" = "200" ] && break
|
||||
done
|
||||
[ "$execute" = "-e" ] && sudo chmod a+x "$file_path"
|
||||
[[ "$execute" = "-e" && -e "$file_path" ]] && sudo chmod a+x "$file_path"
|
||||
[ "$mode" = "-v" ] && echo "$status_code"
|
||||
[ "$runner" = "self-hosted" ] && release_lock "$lock_path"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user