From cff7a636b00ec686c5ae3c6131d86f9ae719794c Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Tue, 7 Nov 2023 22:36:53 +0530 Subject: [PATCH] testing [skip ci] --- __tests__/utils.test.ts | 6 ++-- dist/index.js | 6 ++-- src/config.ts | 2 +- src/scripts/darwin.sh | 28 +++++++-------- src/scripts/extensions/add_extensions.sh | 24 ++++++------- src/scripts/extensions/blackfire.sh | 2 +- src/scripts/extensions/couchbase.sh | 8 ++--- src/scripts/extensions/cubrid.sh | 2 +- src/scripts/extensions/event.sh | 4 +-- src/scripts/extensions/firebird.sh | 8 ++--- src/scripts/extensions/gearman.sh | 2 +- src/scripts/extensions/geos.sh | 2 +- src/scripts/extensions/http.ps1 | 8 ++--- src/scripts/extensions/http.sh | 6 ++-- src/scripts/extensions/intl.sh | 2 +- src/scripts/extensions/ioncube.sh | 2 +- src/scripts/extensions/oci.sh | 4 +-- src/scripts/extensions/phalcon.sh | 4 +-- src/scripts/extensions/relay.sh | 6 ++-- src/scripts/extensions/source.sh | 12 +++---- src/scripts/extensions/sqlsrv.ps1 | 4 +-- src/scripts/extensions/zephir_parser.sh | 2 +- src/scripts/linux.sh | 46 ++++++++++++------------ src/scripts/tools/add_tools.ps1 | 14 ++++---- src/scripts/tools/add_tools.sh | 16 ++++----- src/scripts/tools/blackfire.ps1 | 8 ++--- src/scripts/tools/blackfire.sh | 6 ++-- src/scripts/tools/brew.sh | 8 ++--- src/scripts/tools/grpc_php_plugin.ps1 | 4 +-- src/scripts/tools/grpc_php_plugin.sh | 6 ++-- src/scripts/tools/ppa.sh | 10 +++--- src/scripts/tools/protoc.ps1 | 4 +-- src/scripts/tools/protoc.sh | 2 +- src/scripts/tools/symfony.ps1 | 4 +-- src/scripts/tools/symfony.sh | 2 +- src/scripts/unix.sh | 16 ++++----- src/scripts/win32.ps1 | 16 ++++----- src/utils.ts | 4 +-- 38 files changed, 155 insertions(+), 155 deletions(-) diff --git a/__tests__/utils.test.ts b/__tests__/utils.test.ts index f64be9bf2..842e8b858 100644 --- a/__tests__/utils.test.ts +++ b/__tests__/utils.test.ts @@ -177,9 +177,9 @@ describe('Utils tests', () => { }); it('checking suppressOutput', async () => { - expect(await utils.suppressOutput('win32')).toEqual(' >$null 2>&1'); - expect(await utils.suppressOutput('linux')).toEqual(' >/dev/null 2>&1'); - expect(await utils.suppressOutput('darwin')).toEqual(' >/dev/null 2>&1'); + expect(await utils.suppressOutput('win32')).toEqual(' '); + expect(await utils.suppressOutput('linux')).toEqual(' '); + expect(await utils.suppressOutput('darwin')).toEqual(' '); expect(await utils.suppressOutput('openbsd')).toContain( 'Platform openbsd is not supported' ); diff --git a/dist/index.js b/dist/index.js index b107969c7..174bcbe40 100644 --- a/dist/index.js +++ b/dist/index.js @@ -41,7 +41,7 @@ async function addINIValuesUnix(ini_values_csv) { }); return ('echo "' + ini_values.join('\n') + - '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' + + '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" ' + script); } exports.addINIValuesUnix = addINIValuesUnix; @@ -1291,10 +1291,10 @@ exports.getExtensionPrefix = getExtensionPrefix; async function suppressOutput(os) { switch (os) { case 'win32': - return ' >$null 2>&1'; + return ' '; case 'linux': case 'darwin': - return ' >/dev/null 2>&1'; + return ' '; default: return await log('Platform ' + os + ' is not supported', os, 'error'); } diff --git a/src/config.ts b/src/config.ts index 07f897663..bd6e008c0 100644 --- a/src/config.ts +++ b/src/config.ts @@ -17,7 +17,7 @@ export async function addINIValuesUnix( return ( 'echo "' + ini_values.join('\n') + - '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' + + '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" ' + script ); } diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 09a04263a..8d988d520 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -21,7 +21,7 @@ disable_extension_helper() { sudo sed -Ei '' "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file:?}" sudo rm -rf "$scan_dir"/*"$extension"* /tmp/php"$version"_extensions mkdir -p /tmp/extdisabled/"$version" - echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1 + echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" } # Function to get extension name from brew formula. @@ -60,9 +60,9 @@ add_brew_extension() { add_brew_tap "$php_tap" add_brew_tap "$ext_tap" sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "${core_repo:?}/Formula/" 2>/dev/null || true - update_dependencies >/dev/null 2>&1 - disable_dependency_extensions "$extension" >/dev/null 2>&1 - (brew install -f "$ext_tap/$formula@$version" >/dev/null 2>&1 && copy_brew_extensions "$formula") || pecl_install "$extension" >/dev/null 2>&1 + update_dependencies + disable_dependency_extensions "$extension" + (brew install -f "$ext_tap/$formula@$version" && copy_brew_extensions "$formula") || pecl_install "$extension" add_extension_log "$extension" "Installed and enabled" fi } @@ -72,9 +72,9 @@ add_extension_helper() { local extension=$1 prefix=$2 if [[ "$version" =~ ${old_versions:?} ]] && [ "$extension" = "imagick" ]; then - run_script "php5-darwin" "${version/./}" "$extension" >/dev/null 2>&1 + run_script "php5-darwin" "${version/./}" "$extension" else - pecl_install "$extension" >/dev/null 2>&1 && + pecl_install "$extension" && if [[ "$version" =~ ${old_versions:?} ]]; then echo "$prefix=$ext_dir/$extension.so" >>"$ini_file"; fi fi add_extension_log "$extension" "Installed and enabled" @@ -88,8 +88,8 @@ add_devtools() { # Function to handle request to add PECL. add_pecl() { - enable_extension xml extension >/dev/null 2>&1 - configure_pecl >/dev/null 2>&1 + enable_extension xml extension + configure_pecl pear_version=$(get_tool_version "pecl" "version") add_log "${tick:?}" "PECL" "Found PECL $pear_version" } @@ -147,7 +147,7 @@ update_dependencies() { else git -C "$core_repo" fetch origin master && git -C "$core_repo" reset --hard origin/master fi - echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1 + echo '' | sudo tee /tmp/update_dependencies fi } @@ -206,7 +206,7 @@ add_php_config() { if [[ "$ini" = "production" || "$ini" = "development" ]]; then sudo cp "$ini_dir"/php.ini-"$ini" "$ini_dir"/php.ini elif [ "$ini" = "none" ]; then - echo '' | sudo tee "${ini_file[@]}" >/dev/null 2>&1 + echo '' | sudo tee "${ini_file[@]}" fi } @@ -225,17 +225,17 @@ setup_php() { php_config="$(command -v php-config 2>/dev/null)" existing_version=$(get_brewed_php) if [[ "$version" =~ ${old_versions:?} ]]; then - run_script "php5-darwin" "${version/./}" >/dev/null 2>&1 + run_script "php5-darwin" "${version/./}" status="Installed" elif [ "$existing_version" != "$version" ]; then - add_php "install" "$existing_version" >/dev/null 2>&1 + add_php "install" "$existing_version" status="Installed" elif [ "$existing_version" = "$version" ] && [ "${update:?}" = "true" ]; then - add_php "upgrade" "$existing_version" >/dev/null 2>&1 + add_php "upgrade" "$existing_version" status="Updated to" else status="Found" - fix_dependencies >/dev/null 2>&1 + fix_dependencies fi php_config="$(command -v php-config)" ext_dir="$(grep 'extension_dir=' "$php_config" | cut -d "'" -f 2)" diff --git a/src/scripts/extensions/add_extensions.sh b/src/scripts/extensions/add_extensions.sh index 6ad987098..431204620 100644 --- a/src/scripts/extensions/add_extensions.sh +++ b/src/scripts/extensions/add_extensions.sh @@ -48,7 +48,7 @@ enable_extension() { [ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete enable_extension_dependencies "$1" "$2" enable_cache_extension_dependencies "$1" "$2" - if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod >/dev/null 2>&1; then + if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod ; then sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?\"?$/d" "$pecl_file" mod="${ini_dir:?}"/../mods-available/"$1".ini if ! [ -e "$mod" ]; then @@ -57,7 +57,7 @@ enable_extension() { [ -n "$mod_priority_line" ] && priority=$(echo "$mod_priority_line" | cut -d'=' -f 2) (echo "; priority=$priority"; echo "$2=${ext_dir:?}/$1.so") | sudo tee "$mod" >/dev/null fi - sudo phpenmod -v "$version" "$1" >/dev/null 2>&1 + sudo phpenmod -v "$version" "$1" else echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null fi @@ -69,7 +69,7 @@ enable_extensions() { local extensions=("$@") to_wait=() for ext in "${extensions[@]}"; do - enable_extension "$ext" extension >/dev/null 2>&1 & + enable_extension "$ext" extension & to_wait+=($!) done wait "${to_wait[@]}" @@ -77,7 +77,7 @@ enable_extensions() { # Function to get a map of extensions and their dependent shared extensions. get_extension_map() { - php -d'error_reporting=0' "${src:?}"/scripts/extensions/extension_map.php /tmp/map"$version".orig >/dev/null 2>&1 + php -d'error_reporting=0' "${src:?}"/scripts/extensions/extension_map.php /tmp/map"$version".orig } # Function to enable extension dependencies which are also extensions. @@ -123,7 +123,7 @@ disable_extension() { disable_all_shared() { get_extension_map sudo sed -i.orig -E -e "/^(zend_)?extension\s*=/d" "${ini_file[@]}" "$pecl_file" 2>/dev/null || true - sudo find "${ini_dir:-$scan_dir}"/.. -name "*.ini" -not -path "*php.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true + sudo find "${ini_dir:-$scan_dir}"/.. -name "*.ini" -not -path "*php.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete || true mkdir -p /tmp/extdisabled/"$version" sudo rm -f /tmp/php"$version"_extensions sudo find "$ext_dir" -name '*.so' -print0 | xargs -0 -n 1 basename -s .so | xargs -I{} touch /tmp/extdisabled/"$version"/{} @@ -137,7 +137,7 @@ configure_pecl() { for script in pear pecl; do sudo "$script" channel-update "$script".php.net done - echo '' | sudo tee /tmp/pecl_config >/dev/null 2>&1 + echo '' | sudo tee /tmp/pecl_config fi } @@ -175,17 +175,17 @@ get_pecl_version() { pecl_install() { local extension=$1 local prefix=${2:-extension} - add_pecl >/dev/null 2>&1 + add_pecl cpu_count="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo '1')" prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS) MAKEFLAGS='-j $cpu_count'" suffix_opts="$(parse_args "$extension" CONFIGURE_OPTS) $(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)" IFS=' ' read -r -a libraries <<<"$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)" - (( ${#libraries[@]} )) && add_libs "${libraries[@]}" >/dev/null 2>&1 - disable_extension_helper "${extension%-*}" >/dev/null 2>&1 + (( ${#libraries[@]} )) && add_libs "${libraries[@]}" + disable_extension_helper "${extension%-*}" if [ "$version" = "5.3" ]; then - yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f "$extension" >/dev/null 2>&1 + yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f "$extension" else - yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" >/dev/null 2>&1 + yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" fi local exit_code=$? sudo pecl info "$extension" | grep -iq 'zend extension' && prefix=zend_extension @@ -207,7 +207,7 @@ add_pecl_extension() { add_log "${tick:?}" "$extension" "Enabled" else [ -n "$pecl_version" ] && pecl_version="-$pecl_version" - pecl_install "$extension$pecl_version" || add_extension "$extension" "$(get_extension_prefix "$extension")" >/dev/null 2>&1 + pecl_install "$extension$pecl_version" || add_extension "$extension" "$(get_extension_prefix "$extension")" extension_version="$(php -r "echo phpversion('$extension');")" [ -n "$extension_version" ] && extension_version="-$extension_version" add_extension_log "$extension$extension_version" "Installed and enabled" diff --git a/src/scripts/extensions/blackfire.sh b/src/scripts/extensions/blackfire.sh index fa37e952f..796d0443e 100644 --- a/src/scripts/extensions/blackfire.sh +++ b/src/scripts/extensions/blackfire.sh @@ -15,7 +15,7 @@ add_blackfire() { extension_version=$(get -s -n "" https://blackfire.io/api/v1/releases | grep -Eo 'php":"([0-9]+.[0-9]+.[0-9]+)' | cut -d '"' -f 3) fi fi - get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_amd64-php-"$no_dot_version".so >/dev/null 2>&1 + get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_amd64-php-"$no_dot_version".so fi enable_extension blackfire extension add_extension_log blackfire "$status" diff --git a/src/scripts/extensions/couchbase.sh b/src/scripts/extensions/couchbase.sh index d93b2b485..c3a89e31c 100644 --- a/src/scripts/extensions/couchbase.sh +++ b/src/scripts/extensions/couchbase.sh @@ -47,9 +47,9 @@ add_couchbase() { ext=$(get_couchbase_version) fi if [[ "$ext" =~ couchbase-[2-3].+ ]]; then - add_couchbase_clibs "$ext" >/dev/null 2>&1 + add_couchbase_clibs "$ext" else - add_couchbase_cxxlibs >/dev/null 2>&1 + add_couchbase_cxxlibs fi enable_extension "couchbase" "extension" if check_extension "couchbase"; then @@ -60,9 +60,9 @@ add_couchbase() { n_proc="$(nproc)" export COUCHBASE_SUFFIX_OPTS="CMAKE_BUILD_TYPE=Release" export CMAKE_BUILD_PARALLEL_LEVEL="$n_proc" - add_extension_from_source couchbase https://pecl.php.net couchbase couchbase "${ext##*-}" extension pecl >/dev/null 2>&1 + add_extension_from_source couchbase https://pecl.php.net couchbase couchbase "${ext##*-}" extension pecl else - pecl_install "${ext}" >/dev/null 2>&1 + pecl_install "${ext}" fi add_extension_log "couchbase" "Installed and enabled" fi diff --git a/src/scripts/extensions/cubrid.sh b/src/scripts/extensions/cubrid.sh index 201a667c4..b668ef254 100644 --- a/src/scripts/extensions/cubrid.sh +++ b/src/scripts/extensions/cubrid.sh @@ -51,7 +51,7 @@ add_cubrid_helper() { add_cubrid() { ext=$1 status='Enabled' - add_cubrid_helper "$ext" >/dev/null 2>&1 + add_cubrid_helper "$ext" add_extension_log "$ext" "$status" check_extension "$ext" && add_license_log } diff --git a/src/scripts/extensions/event.sh b/src/scripts/extensions/event.sh index 7519a99b0..63db05c38 100644 --- a/src/scripts/extensions/event.sh +++ b/src/scripts/extensions/event.sh @@ -39,9 +39,9 @@ add_event() { add_log "${tick:?}" "event" "Enabled" else if ! [[ "${version:?}" =~ ${old_versions:?} ]] && [ "$os" = "Darwin" ]; then - add_brew_extension event extension >/dev/null 2>&1 + add_brew_extension event extension else - add_event_helper "$ext" >/dev/null 2>&1 + add_event_helper "$ext" fi add_extension_log "event" "Installed and enabled" fi diff --git a/src/scripts/extensions/firebird.sh b/src/scripts/extensions/firebird.sh index 065afb3a0..4695b7ffd 100644 --- a/src/scripts/extensions/firebird.sh +++ b/src/scripts/extensions/firebird.sh @@ -20,7 +20,7 @@ add_firebird_helper() { add_firebird() { if [ "$(uname -s )" = "Darwin" ]; then - add_firebird_client_darwin >/dev/null 2>&1 + add_firebird_client_darwin fi enable_extension pdo_firebird extension status="Enabled" @@ -28,12 +28,12 @@ add_firebird() { status="Installed and enabled" if [ "$(uname -s)" = "Linux" ]; then if [[ "${version:?}" =~ 5.3|${nightly_versions:?} ]]; then - add_firebird_helper /usr >/dev/null 2>&1 + add_firebird_helper /usr else - add_pdo_extension firebird >/dev/null 2>&1 + add_pdo_extension firebird fi else - add_firebird_helper /opt/firebird >/dev/null 2>&1 + add_firebird_helper /opt/firebird fi fi add_extension_log pdo_firebird "$status" diff --git a/src/scripts/extensions/gearman.sh b/src/scripts/extensions/gearman.sh index eb732dcfe..1bc19ea8c 100644 --- a/src/scripts/extensions/gearman.sh +++ b/src/scripts/extensions/gearman.sh @@ -18,7 +18,7 @@ add_gearman_helper() { add_gearman() { status="Enabled" if [ "$(uname -s)" = 'Linux' ]; then - add_gearman_helper >/dev/null 2>&1 + add_gearman_helper add_extension_log "gearman" "$status" else add_brew_extension gearman extension diff --git a/src/scripts/extensions/geos.sh b/src/scripts/extensions/geos.sh index c685f8664..5825556ac 100644 --- a/src/scripts/extensions/geos.sh +++ b/src/scripts/extensions/geos.sh @@ -11,7 +11,7 @@ add_geos() { if check_extension "geos"; then add_log "${tick:?}" "geos" "Enabled" else - add_geos_helper >/dev/null 2>&1 + add_geos_helper add_extension_log "geos" "Installed and enabled" fi } diff --git a/src/scripts/extensions/http.ps1 b/src/scripts/extensions/http.ps1 index 16d9da3a3..9709c5586 100644 --- a/src/scripts/extensions/http.ps1 +++ b/src/scripts/extensions/http.ps1 @@ -40,12 +40,12 @@ Function Repair-ICU() { } Function Add-Http() { - Add-Extension iconv >$null 2>&1 - Add-Extension raphf >$null 2>&1 + Add-Extension iconv + Add-Extension raphf if($version -lt '8.0') { - Add-Extension propro >$null 2>&1 + Add-Extension propro } - Add-Extension pecl_http >$null 2>&1 + Add-Extension pecl_http Repair-ICU Add-ExtensionLog http "Installed and enabled" } \ No newline at end of file diff --git a/src/scripts/extensions/http.sh b/src/scripts/extensions/http.sh index 6880298e2..0d4d0f28b 100644 --- a/src/scripts/extensions/http.sh +++ b/src/scripts/extensions/http.sh @@ -75,7 +75,7 @@ add_http_latest() { if [ "$os" = "Linux" ]; then add_http_dependencies package="php$version-http" - add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php + add_ppa ondrej/php || update_ppa ondrej/php (check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os" else if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then @@ -103,9 +103,9 @@ add_http() { ext=$1 status="Enabled" if [[ "$ext" =~ ^(pecl_http|http)$ ]]; then - add_http_latest >/dev/null 2>&1 + add_http_latest else - add_http_version "$ext" >/dev/null 2>&1 + add_http_version "$ext" fi add_extension_log "http" "$status" } diff --git a/src/scripts/extensions/intl.sh b/src/scripts/extensions/intl.sh index a1ba481d3..8b3d0a48f 100644 --- a/src/scripts/extensions/intl.sh +++ b/src/scripts/extensions/intl.sh @@ -16,7 +16,7 @@ add_intl() { add_log "${cross:?}" "intl" "ICU $icu is not supported" else [ "${ts:?}" = 'zts' ] && suffix='-zts' - install_icu "$icu" >/dev/null 2>&1 + install_icu "$icu" get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix.so" enable_extension intl extension add_extension_log intl "Installed and enabled with ICU $icu" diff --git a/src/scripts/extensions/ioncube.sh b/src/scripts/extensions/ioncube.sh index bfb038d63..bd278eaca 100644 --- a/src/scripts/extensions/ioncube.sh +++ b/src/scripts/extensions/ioncube.sh @@ -15,7 +15,7 @@ add_ioncube() { sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "${ext_dir:?}/ioncube.so" sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt fi - echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1 + echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" add_extension_log "ioncube" "$status" check_extension "ioncube" && add_license_log } diff --git a/src/scripts/extensions/oci.sh b/src/scripts/extensions/oci.sh index 838be60d0..ca8ec5fb5 100644 --- a/src/scripts/extensions/oci.sh +++ b/src/scripts/extensions/oci.sh @@ -55,8 +55,8 @@ add_oci() { oracle_home='/opt/oracle' oracle_client=$oracle_home/instantclient os=$(uname -s) - add_client >/dev/null 2>&1 - add_oci_helper >/dev/null 2>&1 + add_client + add_oci_helper add_extension_log "$ext" "$status" check_extension "$ext" && add_license_log } diff --git a/src/scripts/extensions/phalcon.sh b/src/scripts/extensions/phalcon.sh index ea70f0ca3..d2b96a897 100644 --- a/src/scripts/extensions/phalcon.sh +++ b/src/scripts/extensions/phalcon.sh @@ -30,7 +30,7 @@ add_phalcon_helper() { add_brew_extension "$extension" extension else package="php${version:?}-$extension" - add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php + add_ppa ondrej/php || update_ppa ondrej/php [ "$extension" = "phalcon4" ] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0) (check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo fi @@ -89,7 +89,7 @@ add_phalcon() { status='Enabled' extension_major_version=${extension: -1} if [[ "$extension_major_version" =~ [3-5] ]]; then - add_phalcon"$extension_major_version" >/dev/null 2>&1 + add_phalcon"$extension_major_version" fi add_extension_log "phalcon" "$status" } diff --git a/src/scripts/extensions/relay.sh b/src/scripts/extensions/relay.sh index 368c0f0a1..447c6f5e9 100644 --- a/src/scripts/extensions/relay.sh +++ b/src/scripts/extensions/relay.sh @@ -134,13 +134,13 @@ add_relay() { relay_releases=https://github.com/cachewerk/relay/releases relay_trunk=https://builds.r2.relay.so relay_version=$(get_relay_version "$ext") - add_relay_dependencies >/dev/null 2>&1 + add_relay_dependencies if shared_extension relay; then message="Enabled" else - add_relay_helper >/dev/null 2>&1 + add_relay_helper message="Installed and enabled" fi - configure_relay >/dev/null 2>&1 + configure_relay add_extension_log relay "$message" } diff --git a/src/scripts/extensions/source.sh b/src/scripts/extensions/source.sh index 36d15fb28..ab6b60c08 100644 --- a/src/scripts/extensions/source.sh +++ b/src/scripts/extensions/source.sh @@ -47,7 +47,7 @@ check_lib() { add_linux_libs() { local lib=$1 if ! check_lib "$lib"; then - install_packages "$lib" >/dev/null 2>&1 || true + install_packages "$lib" || true fi add_lib_log "$lib" } @@ -56,9 +56,9 @@ add_linux_libs() { add_darwin_libs() { local lib=$1 if ! check_lib "$lib"; then - brew install "$lib" >/dev/null 2>&1 || true + brew install "$lib" || true if [[ "$lib" = *@* ]]; then - brew link --overwrite --force "$lib" >/dev/null 2>&1 || true + brew link --overwrite --force "$lib" || true fi fi add_lib_log "$lib" @@ -80,7 +80,7 @@ add_libs() { run_group() { local command=$1 local log=$2 - echo "$command" | sudo tee ./run_group.sh >/dev/null 2>&1 + echo "$command" | sudo tee ./run_group.sh echo "$GROUP$log" . ./run_group.sh rm ./run_group.sh @@ -139,7 +139,7 @@ add_extension_from_source() { sub_dir="$(parse_args "$extension" PATH)" step_log "Setup $slug" ( - add_devtools phpize >/dev/null 2>&1 + add_devtools phpize disable_extension_helper "$extension" fetch_extension "$extension" "$fetch" if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then @@ -147,7 +147,7 @@ add_extension_from_source() { else [[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries" [ "${debug:?}" = "debug" ] && suffix_opts="$suffix_opts --enable-debug" - patch_extension "$extension" >/dev/null 2>&1 + patch_extension "$extension" run_group "phpize" "phpize" run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure" run_group "sudo make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make" diff --git a/src/scripts/extensions/sqlsrv.ps1 b/src/scripts/extensions/sqlsrv.ps1 index 00ae5df80..7c4678083 100644 --- a/src/scripts/extensions/sqlsrv.ps1 +++ b/src/scripts/extensions/sqlsrv.ps1 @@ -59,9 +59,9 @@ Function Add-Sqlsrv() { if (Test-Path $ext_dir\php_$extension.dll) { Enable-PhpExtension -Extension $extension -Path $php_dir } else { - Add-SqlsrvFromGithub $extension >$null 2>&1 + Add-SqlsrvFromGithub $extension if (-not(Test-Extension $extension)) { - Add-Extension $extension >$null 2>&1 + Add-Extension $extension } $status = 'Installed and enabled' } diff --git a/src/scripts/extensions/zephir_parser.sh b/src/scripts/extensions/zephir_parser.sh index f1c9b5d3a..dfdd59c59 100644 --- a/src/scripts/extensions/zephir_parser.sh +++ b/src/scripts/extensions/zephir_parser.sh @@ -29,7 +29,7 @@ add_zephir_parser() { zp_releases=https://github.com/"$repo"/releases if ! shared_extension zephir_parser; then message='Installed and enabled' - add_zephir_parser_helper "$ext" >/dev/null 2>&1 + add_zephir_parser_helper "$ext" else message='Enabled' enable_extension zephir_parser extension diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 9edf759d7..c4f50e9c5 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -17,13 +17,13 @@ self_hosted_helper() { # Function to fix broken packages. fix_broken_packages() { - sudo apt --fix-broken install >/dev/null 2>&1 + sudo apt --fix-broken install } # Function to install a package install_packages() { packages=("$@") - $apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1) + $apt_install "${packages[@]}" || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" ) } # Function to disable an extension. @@ -35,10 +35,10 @@ disable_extension_helper() { disable_extension_dependents "$extension" fi sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?\"?$/d" "${ini_file[@]}" "$pecl_file" - sudo find "$ini_dir"/.. -name "*-$extension.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true + sudo find "$ini_dir"/.. -name "*-$extension.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete || true sudo rm -f /tmp/php"$version"_extensions mkdir -p /tmp/extdisabled/"$version" - echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1 + echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" } # Function to add PDO extension. @@ -51,7 +51,7 @@ add_pdo_extension() { ext_name=$1 if shared_extension pdo; then disable_extension_helper pdo - echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" >/dev/null 2>&1 + echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" fi if [ "$ext" = "mysql" ]; then enable_extension "mysqlnd" "extension" @@ -59,15 +59,15 @@ add_pdo_extension() { elif [ "$ext" = "dblib" ]; then ext_name="sybase" elif [ "$ext" = "firebird" ]; then - install_packages libfbclient2 >/dev/null 2>&1 + install_packages libfbclient2 enable_extension "pdo_firebird" "extension" ext_name="interbase" elif [ "$ext" = "sqlite" ]; then ext="sqlite3" ext_name="sqlite3" fi - add_extension "$ext_name" "extension" >/dev/null 2>&1 - add_extension "$pdo_ext" "extension" >/dev/null 2>&1 + add_extension "$ext_name" "extension" + add_extension "$pdo_ext" "extension" add_extension_log "$pdo_ext" "Enabled" fi } @@ -81,7 +81,7 @@ check_package() { add_extension_helper() { local extension=$1 packages=(php"$version"-"$extension") - add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php + add_ppa ondrej/php || update_ppa ondrej/php [ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym) (check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension" add_extension_log "$extension" "Installed and enabled" @@ -95,7 +95,7 @@ add_devtools() { install_packages "php$version-dev" fi switch_version "phpize" "php-config" - add_extension xml extension >/dev/null 2>&1 + add_extension xml extension add_log "${tick:?}" "$tool" "Added $tool $semver" } @@ -111,11 +111,11 @@ setup_old_versions() { # Function to add PECL. add_pecl() { - add_devtools phpize >/dev/null 2>&1 + add_devtools phpize if ! command -v pecl >/dev/null; then install_packages php-pear fi - configure_pecl >/dev/null 2>&1 + configure_pecl pear_version=$(get_tool_version "pecl" "version") add_log "${tick:?}" "PECL" "Added PECL $pear_version" } @@ -150,7 +150,7 @@ get_php_packages() { # Function to install packaged PHP add_packaged_php() { if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then - add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php + add_ppa ondrej/php || update_ppa ondrej/php IFS=' ' read -r -a packages <<<"$(get_php_packages)" install_packages "${packages[@]}" else @@ -178,7 +178,7 @@ add_php() { setup_old_versions else add_packaged_php - switch_version >/dev/null 2>&1 + switch_version add_pecl fi status="Installed" @@ -186,7 +186,7 @@ add_php() { # Function to ini file for pear and link it to each SAPI. link_pecl_file() { - echo '' | sudo tee "$pecl_file" >/dev/null 2>&1 + echo '' | sudo tee "$pecl_file" for file in "${ini_file[@]}"; do sapi_scan_dir="$(realpath -m "$(dirname "$file")")/conf.d" if [ "$sapi_scan_dir" != "$scan_dir" ] && ! [ -h "$sapi_scan_dir" ]; then @@ -219,9 +219,9 @@ add_php_config() { elif [ "$ini" = "development" ]; then echo "${ini_file[@]}" | xargs -n 1 -P 6 sudo cp "$php_lib_dir"/php.ini-development elif [ "$ini" = "none" ]; then - echo '' | sudo tee "${ini_file[@]}" >/dev/null 2>&1 + echo '' | sudo tee "${ini_file[@]}" fi - echo "$ini" | sudo tee "$current_ini" >/dev/null 2>&1 + echo "$ini" | sudo tee "$current_ini" } # Function to Setup PHP @@ -231,13 +231,13 @@ setup_php() { php_config="$(command -v php-config)" if [[ -z "$php_config" ]] || [ "$(php_semver | cut -c 1-3)" != "$version" ]; then if [ ! -e "/usr/bin/php$version" ] || [ ! -e "/usr/bin/php-config$version" ]; then - add_php >/dev/null 2>&1 + add_php else if ! [[ "$version" =~ ${old_versions:?} ]]; then - switch_version >/dev/null 2>&1 + switch_version fi if [ "${update:?}" = "true" ]; then - update_php >/dev/null 2>&1 + update_php else status="Switched to" fi @@ -245,7 +245,7 @@ setup_php() { php_config="$(command -v php-config)" else if [ "$update" = "true" ]; then - update_php >/dev/null 2>&1 + update_php else status="Found" fi @@ -265,7 +265,7 @@ setup_php() { link_pecl_file configure_php set_output "php-version" "$semver" - sudo rm -rf /usr/local/bin/phpunit >/dev/null 2>&1 + sudo rm -rf /usr/local/bin/phpunit sudo chmod 777 "${ini_file[@]}" "$pecl_file" "${tool_path_dir:?}" sudo cp "$src"/configs/pm/*.json "$RUNNER_TOOL_CACHE/" add_log "${tick:?}" "PHP" "$status PHP $semver$extra_version" @@ -279,7 +279,7 @@ debconf_fix="DEBIAN_FRONTEND=noninteractive" apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends" scripts="$src"/scripts -add_sudo >/dev/null 2>&1 +add_sudo . /etc/os-release # shellcheck source=. diff --git a/src/scripts/tools/add_tools.ps1 b/src/scripts/tools/add_tools.ps1 index b117d3497..098c79368 100644 --- a/src/scripts/tools/add_tools.ps1 +++ b/src/scripts/tools/add_tools.ps1 @@ -113,7 +113,7 @@ Function Add-ToolsHelper() { $extensions += @('json', 'tokenizer') } elseif($tool -eq "phpDocumentor") { $extensions+=('ctype', 'hash', 'json', 'fileinfo', 'iconv', 'mbstring', 'simplexml', 'xml') - Add-Extension fileinfo >$null 2>&1 + Add-Extension fileinfo Copy-Item $bin_dir\phpDocumentor.bat -Destination $bin_dir\phpdoc.bat } elseif($tool -eq "phpunit") { $extensions += @('dom', 'json', 'libxml', 'mbstring', 'xml', 'xmlwriter') @@ -126,7 +126,7 @@ Function Add-ToolsHelper() { Copy-Item $bin_dir\wp-cli.bat -Destination $bin_dir\wp.bat } foreach($extension in $extensions) { - Add-Extension $extension >$null 2>&1 + Add-Extension $extension } } @@ -173,7 +173,7 @@ Function Add-Tool() { $bat_content += "php %BIN_TARGET% %*" Set-Content -Path $bin_dir\$tool.bat -Value $bat_content Add-ToolsHelper $tool - Add-ToProfile $current_profile $tool "New-Alias $tool $bin_dir\$tool.bat" >$null 2>&1 + Add-ToProfile $current_profile $tool "New-Alias $tool $bin_dir\$tool.bat" $tool_version = Get-ToolVersion $tool $ver_param Add-Log $tick $tool "Added $tool $tool_version" } else { @@ -213,9 +213,9 @@ Function Add-ComposerToolHelper() { Remove-Item -Path $composer_lock -Force } if((composer global show $prefix$tool $tool_version -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) { - composer global config --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1 + composer global config --no-plugins allow-plugins."$prefix$tool" true } - composer global require $prefix$release $composer_args >$null 2>&1 + composer global require $prefix$release $composer_args return composer global show $prefix$tool 2>&1 | findstr '^versions' } else { $release_stream = [System.IO.MemoryStream]::New([System.Text.Encoding]::ASCII.GetBytes($release)) @@ -226,9 +226,9 @@ Function Add-ComposerToolHelper() { New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1 Set-Content -Path $scoped_dir\composer.json -Value "{}" if((composer show $prefix$tool $tool_version -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) { - composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1 + composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true } - composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1 + composer require $prefix$release -d $unix_scoped_dir $composer_args } [System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin") Add-Path $scoped_dir\vendor\bin diff --git a/src/scripts/tools/add_tools.sh b/src/scripts/tools/add_tools.sh index 0ffbba51d..62f4a0198 100644 --- a/src/scripts/tools/add_tools.sh +++ b/src/scripts/tools/add_tools.sh @@ -122,7 +122,7 @@ add_tools_helper() { sudo ln -s "$tool_path" "$tool_path_dir"/"${tool%-*}" fi for extension in "${extensions[@]}"; do - add_extension "$extension" extension >/dev/null 2>&1 + add_extension "$extension" extension done } @@ -169,22 +169,22 @@ add_composer_tool_helper() { enable_extensions curl mbstring openssl tool_version=${release##*:}; [ "$tool_version" = "$tool" ] && tool_version="*" if [ "$scope" = "global" ]; then - sudo rm -f "$composer_lock" >/dev/null 2>&1 || true + sudo rm -f "$composer_lock" || true if composer global show "$prefix$tool" "$tool_version" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then - composer global config --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1 + composer global config --no-plugins allow-plugins."$prefix$tool" true fi - composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1 - composer global show "$prefix$tool" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1 + composer global require "$prefix$release" "$composer_args" + composer global show "$prefix$tool" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log else scoped_dir="$composer_bin/_tools/$tool-$(echo -n "$release" | shasum -a 256 | cut -d ' ' -f 1)" if ! [ -d "$scoped_dir" ]; then mkdir -p "$scoped_dir" echo '{}' | tee "$scoped_dir/composer.json" >/dev/null if composer show "$prefix$tool" "$tool_version" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then - composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1 + composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true fi - composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1 - composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1 + composer require "$prefix$release" -d "$scoped_dir" "$composer_args" + composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log fi add_path "$scoped_dir"/vendor/bin fi diff --git a/src/scripts/tools/blackfire.ps1 b/src/scripts/tools/blackfire.ps1 index 4427ef7d8..94e6b084f 100644 --- a/src/scripts/tools/blackfire.ps1 +++ b/src/scripts/tools/blackfire.ps1 @@ -6,14 +6,14 @@ Function Add-Blackfire() { } $cli_version = (Invoke-RestMethod https://blackfire.io/api/v1/releases).cli $url = "https://packages.blackfire.io/binaries/blackfire/${cli_version}/blackfire-windows_${arch_name}.zip" - Get-File -Url $url -OutFile $bin_dir\blackfire.zip >$null 2>&1 - Expand-Archive -Path $bin_dir\blackfire.zip -DestinationPath $bin_dir -Force >$null 2>&1 + Get-File -Url $url -OutFile $bin_dir\blackfire.zip + Expand-Archive -Path $bin_dir\blackfire.zip -DestinationPath $bin_dir -Force Add-ToProfile $current_profile 'blackfire' "New-Alias blackfire $bin_dir\blackfire.exe" if ((Test-Path env:BLACKFIRE_SERVER_ID) -and (Test-Path env:BLACKFIRE_SERVER_TOKEN)) { - blackfire agent:config --server-id=$env:BLACKFIRE_SERVER_ID --server-token=$env:BLACKFIRE_SERVER_TOKEN >$null 2>&1 + blackfire agent:config --server-id=$env:BLACKFIRE_SERVER_ID --server-token=$env:BLACKFIRE_SERVER_TOKEN } if ((Test-Path env:BLACKFIRE_CLIENT_ID) -and (Test-Path env:BLACKFIRE_CLIENT_TOKEN)) { - blackfire client:config --client-id=$env:BLACKFIRE_CLIENT_ID --client-token=$env:BLACKFIRE_CLIENT_TOKEN --ca-cert=$php_dir\ssl\cacert.pem >$null 2>&1 + blackfire client:config --client-id=$env:BLACKFIRE_CLIENT_ID --client-token=$env:BLACKFIRE_CLIENT_TOKEN --ca-cert=$php_dir\ssl\cacert.pem } Add-Log $tick "blackfire" "Added blackfire $cli_version" } diff --git a/src/scripts/tools/blackfire.sh b/src/scripts/tools/blackfire.sh index 70fa4f642..a53579f7d 100644 --- a/src/scripts/tools/blackfire.sh +++ b/src/scripts/tools/blackfire.sh @@ -32,9 +32,9 @@ blackfire_config() { # Function to add blackfire cli. add_blackfire() { os="$(uname -s)" - [ "$os" = "Linux" ] && add_blackfire_linux >/dev/null 2>&1 - [ "$os" = "Darwin" ] && add_blackfire_darwin >/dev/null 2>&1 - blackfire_config >/dev/null 2>&1 + [ "$os" = "Linux" ] && add_blackfire_linux + [ "$os" = "Darwin" ] && add_blackfire_darwin + blackfire_config tool_version=$(get_tool_version "blackfire" "version") add_log "${tick:?}" "blackfire" "Added blackfire $tool_version" } diff --git a/src/scripts/tools/brew.sh b/src/scripts/tools/brew.sh index efddc9fc1..901423cce 100644 --- a/src/scripts/tools/brew.sh +++ b/src/scripts/tools/brew.sh @@ -14,11 +14,11 @@ add_brew_tap() { tap=$1 if ! [ -d "$tap_dir/$tap" ]; then if [ "${runner:?}" = "self-hosted" ]; then - brew tap "$tap" >/dev/null 2>&1 + brew tap "$tap" else - fetch_brew_tap "$tap" >/dev/null 2>&1 + fetch_brew_tap "$tap" if ! [ -d "$tap_dir/$tap" ]; then - brew tap "$tap" >/dev/null 2>&1 + brew tap "$tap" fi fi fi @@ -49,7 +49,7 @@ add_brew() { brew_prefix="$(get_brew_prefix)" if ! [ -d "$brew_prefix"/bin ]; then step_log "Setup Brew" - get -s "" "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" | bash -s >/dev/null 2>&1 + get -s "" "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" | bash -s add_log "${tick:?}" "Brew" "Installed Homebrew" fi add_brew_bins_to_path "$brew_prefix" diff --git a/src/scripts/tools/grpc_php_plugin.ps1 b/src/scripts/tools/grpc_php_plugin.ps1 index f40bf2814..a1c9650ff 100644 --- a/src/scripts/tools/grpc_php_plugin.ps1 +++ b/src/scripts/tools/grpc_php_plugin.ps1 @@ -1,7 +1,7 @@ Function Add-Msys2() { $msys_location = 'C:\msys64' if (-not(Test-Path $msys_location)) { - choco install msys2 -y >$null 2>&1 + choco install msys2 -y $msys_location = 'C:\tools\msys64' } return $msys_location @@ -9,7 +9,7 @@ Function Add-Msys2() { Function Add-GrpcPhpPlugin() { $msys_location = Add-Msys2 - $logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" >$null 2>&1 + $logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" $grpc_version = Get-ToolVersion 'Write-Output' "$logs" Add-Path $msys_location\mingw64\bin Set-Output grpc_php_plugin_path "$msys_location\mingw64\bin\grpc_php_plugin.exe" diff --git a/src/scripts/tools/grpc_php_plugin.sh b/src/scripts/tools/grpc_php_plugin.sh index 240342658..623d395cb 100644 --- a/src/scripts/tools/grpc_php_plugin.sh +++ b/src/scripts/tools/grpc_php_plugin.sh @@ -25,7 +25,7 @@ add_grpc_php_plugin_brew() { . "${0%/*}"/tools/brew.sh configure_brew brew install grpc - brew link --force --overwrite grpc >/dev/null 2>&1 + brew link --force --overwrite grpc grpc_tag="v$(brew info grpc | grep "grpc:" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")" license_path="$(brew --prefix grpc)/LICENSE" } @@ -48,9 +48,9 @@ add_grpc_php_plugin() { grpc_tag=$1 license_path="" if [ "$grpc_tag" = "latest" ]; then - add_grpc_php_plugin_brew >/dev/null 2>&1 + add_grpc_php_plugin_brew else - add_grpc_php_plugin_compile >/dev/null 2>&1 + add_grpc_php_plugin_compile fi set_output grpc_php_plugin_path "$(command -v grpc_php_plugin)" add_log "${tick:?}" "grpc_php_plugin" "Added grpc_php_plugin ${grpc_tag:1}" diff --git a/src/scripts/tools/ppa.sh b/src/scripts/tools/ppa.sh index b3d8d0456..bfa760ee5 100644 --- a/src/scripts/tools/ppa.sh +++ b/src/scripts/tools/ppa.sh @@ -31,7 +31,7 @@ set_base_version() { else set_base_version_codename set_base_version_id - printf "ID=%s\nVERSION_ID=%s\nVERSION_CODENAME=%s\n" "$ID" "$VERSION_ID" "$VERSION_CODENAME" | tee /tmp/os-release >/dev/null 2>&1 + printf "ID=%s\nVERSION_ID=%s\nVERSION_CODENAME=%s\n" "$ID" "$VERSION_ID" "$VERSION_CODENAME" | tee /tmp/os-release fi } @@ -59,8 +59,8 @@ update_lists() { list="$list_file" fi if [ ! -e "$status_file" ]; then - update_lists_helper "$list" >/dev/null 2>&1 - echo '' | tee "$status_file" >/dev/null 2>&1 + update_lists_helper "$list" + echo '' | tee "$status_file" fi } @@ -95,7 +95,7 @@ add_key() { fi [ ! -e "$key_source" ] && get -q -n "$key_file" "${key_urls[@]}" if [[ "$(file "$key_file")" =~ .*('Public-Key (old)'|'Secret-Key') ]]; then - sudo gpg --batch --yes --dearmor "$key_file" >/dev/null 2>&1 && sudo mv "$key_file".gpg "$key_file" + sudo gpg --batch --yes --dearmor "$key_file" && sudo mv "$key_file".gpg "$key_file" fi } @@ -129,7 +129,7 @@ add_list() { arch=$(dpkg --print-architecture) [ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file" - echo "deb [arch=$arch signed-by=$key_file] $ppa_url $package_dist $branches" | sudo tee -a "$list_dir"/"${ppa/\//-}".list >/dev/null 2>&1 + echo "deb [arch=$arch signed-by=$key_file] $ppa_url $package_dist $branches" | sudo tee -a "$list_dir"/"${ppa/\//-}".list update_lists "$ppa" "$ppa_search" . /etc/os-release fi diff --git a/src/scripts/tools/protoc.ps1 b/src/scripts/tools/protoc.ps1 index ea5e6172e..f3dd4c919 100644 --- a/src/scripts/tools/protoc.ps1 +++ b/src/scripts/tools/protoc.ps1 @@ -29,8 +29,8 @@ Function Add-Protoc() { $arch_num = '32' } $url = "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-$($protobuf_tag -replace 'v', '')-win$arch_num.zip" - Get-File -Url $url -OutFile $bin_dir\protoc.zip >$null 2>&1 - Expand-Archive -Path $bin_dir\protoc.zip -DestinationPath $bin_dir\protoc -Force >$null 2>&1 + Get-File -Url $url -OutFile $bin_dir\protoc.zip + Expand-Archive -Path $bin_dir\protoc.zip -DestinationPath $bin_dir\protoc -Force Move-Item -Path $bin_dir\protoc\bin\protoc.exe -Destination $bin_dir\protoc.exe Add-ToProfile $current_profile 'protoc' "New-Alias protoc $bin_dir\protoc.exe" Add-Log $tick "protoc" "Added protoc $($protobuf_tag -replace 'v', '')" diff --git a/src/scripts/tools/protoc.sh b/src/scripts/tools/protoc.sh index ad00fb695..3a983fb76 100644 --- a/src/scripts/tools/protoc.sh +++ b/src/scripts/tools/protoc.sh @@ -20,7 +20,7 @@ add_protoc() { get -q -n /tmp/protobuf.zip "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-${protobuf_tag:1}-$platform-x86_64.zip" sudo unzip /tmp/protobuf.zip -d /usr/local/ sudo chmod -R 777 /usr/local/bin/protoc /usr/local/include/google - ) >/dev/null 2>&1 + ) add_log "${tick:?}" "protoc" "Added protoc ${protobuf_tag:1}" printf "$GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "protoc" "Click to read the protoc related license information" curl "${curl_opts[@]:?}" https://raw.githubusercontent.com/protocolbuffers/protobuf/master/LICENSE diff --git a/src/scripts/tools/symfony.ps1 b/src/scripts/tools/symfony.ps1 index 3c334d2fa..03116fa33 100644 --- a/src/scripts/tools/symfony.ps1 +++ b/src/scripts/tools/symfony.ps1 @@ -4,8 +4,8 @@ Function Add-Symfony() { $arch_name = '386' } $url = "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_windows_${arch_name}.zip" - Get-File -Url $url -OutFile $bin_dir\symfony.zip >$null 2>&1 - Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force >$null 2>&1 + Get-File -Url $url -OutFile $bin_dir\symfony.zip + Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force if(Test-Path $bin_dir\symfony.exe) { Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe > $null 2>&1 Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe" diff --git a/src/scripts/tools/symfony.sh b/src/scripts/tools/symfony.sh index 03d2de240..090761ce7 100644 --- a/src/scripts/tools/symfony.sh +++ b/src/scripts/tools/symfony.sh @@ -29,7 +29,7 @@ add_symfony_helper() { } add_symfony() { - add_symfony_helper >/dev/null 2>&1 + add_symfony_helper symfony_path="$(command -v symfony)" if [[ -n "$symfony_path" ]]; then sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli diff --git a/src/scripts/unix.sh b/src/scripts/unix.sh index 6abde86f8..1b34ec1ce 100644 --- a/src/scripts/unix.sh +++ b/src/scripts/unix.sh @@ -43,7 +43,7 @@ set_output() { name=$1 value=$2 if [ "${GITHUB_ACTIONS}" = "true" ]; then - echo "${name}=${value}" | tee -a "$GITHUB_OUTPUT" >/dev/null 2>&1 + echo "${name}=${value}" | tee -a "$GITHUB_OUTPUT" fi } @@ -113,10 +113,10 @@ add_path() { path_to_add=$1 [[ ":$PATH:" == *":$path_to_add:"* ]] && return if [[ -n "$GITHUB_PATH" ]]; then - echo "$path_to_add" | tee -a "$GITHUB_PATH" >/dev/null 2>&1 + echo "$path_to_add" | tee -a "$GITHUB_PATH" else profile=$(get_shell_profile) - ([ -e "$profile" ] && grep -q ":$path_to_add\"" "$profile" 2>/dev/null) || echo "export PATH=\"\${PATH:+\${PATH}:}\"$path_to_add" | sudo tee -a "$profile" >/dev/null 2>&1 + ([ -e "$profile" ] && grep -q ":$path_to_add\"" "$profile" 2>/dev/null) || echo "export PATH=\"\${PATH:+\${PATH}:}\"$path_to_add" | sudo tee -a "$profile" fi export PATH="${PATH:+${PATH}:}$path_to_add" } @@ -138,10 +138,10 @@ add_env() { env_name=$1 env_value=$2 if [[ -n "$GITHUB_ENV" ]]; then - echo "$env_name=$env_value" | tee -a "$GITHUB_ENV" >/dev/null 2>&1 + echo "$env_name=$env_value" | tee -a "$GITHUB_ENV" else profile=$(get_shell_profile) - echo "export $env_name=\"$env_value\"" | sudo tee -a "$profile" >/dev/null 2>&1 + echo "export $env_name=\"$env_value\"" | sudo tee -a "$profile" fi export "$env_name"="$env_value" } @@ -162,7 +162,7 @@ self_hosted_setup() { add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner" exit 1 else - self_hosted_helper >/dev/null 2>&1 + self_hosted_helper add_env RUNNER_TOOL_CACHE /tmp fi fi @@ -175,8 +175,8 @@ configure_php() { ini_config_files=("$ini_config_dir"/php.ini) jit_config_files=("$ini_config_dir"/jit.ini) [[ "$version" =~ $xdebug3_versions ]] && ini_config_files+=("$ini_config_dir"/xdebug.ini) - cat "${ini_config_files[@]}" | sudo tee -a "${ini_file[@]:?}" >/dev/null 2>&1 - [[ "$version" =~ $jit_versions ]] && cat "${jit_config_files[@]}" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1 + cat "${ini_config_files[@]}" | sudo tee -a "${ini_file[@]:?}" + [[ "$version" =~ $jit_versions ]] && cat "${jit_config_files[@]}" | sudo tee -a "${pecl_file:-${ini_file[@]}}" } # Function to get PHP version in semver format. diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index e9bae6245..ab67e59d0 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -355,7 +355,7 @@ if(-not($env:ImageOS) -and -not($env:ImageVersion)) { $bin_dir = 'C:\tools\bin' $php_dir = "$php_dir$version" $ext_dir = "$php_dir\ext" - Get-CleanPSProfile >$null 2>&1 + Get-CleanPSProfile New-Item $bin_dir -Type Directory -Force > $null 2>&1 Add-Path -PathItem $bin_dir if($version -lt 5.6) { @@ -368,12 +368,12 @@ if(-not($env:ImageOS) -and -not($env:ImageVersion)) { } New-Item $php_dir -Type Directory -Force > $null 2>&1 Add-Path -PathItem $php_dir - setx PHPROOT $php_dir >$null 2>&1 + setx PHPROOT $php_dir Add-Env -EnvName RUNNER_TOOL_CACHE -EnvValue $env:TEMP } else { $current_profile = "$PSHOME\Profile.ps1" if(-not(Test-Path -LiteralPath $current_profile)) { - New-Item -Path $current_profile -ItemType "file" -Force >$null 2>&1 + New-Item -Path $current_profile -ItemType "file" -Force } } @@ -381,9 +381,9 @@ $src = Join-Path -Path $PSScriptRoot -ChildPath \.. . $src\scripts\tools\add_tools.ps1 . $src\scripts\extensions\add_extensions.ps1 -Add-Printf >$null 2>&1 +Add-Printf Step-Log "Setup PhpManager" -Install-PSPackage PhpManager PhpManager\PhpManager "$github/mlocati/powershell-phpmanager/releases/latest/download/PhpManager.zip" Get-Php >$null 2>&1 +Install-PSPackage PhpManager PhpManager\PhpManager "$github/mlocati/powershell-phpmanager/releases/latest/download/PhpManager.zip" Get-Php Add-Log $tick "PhpManager" "Installed" Step-Log "Setup PHP" @@ -403,7 +403,7 @@ $status = "Installed" $extra_version = "" if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) { if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) { - Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1 + Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList } try { if ($version -match $nightly_versions) { @@ -416,7 +416,7 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version } catch { } } else { if($env:update -eq 'true') { - Update-Php $php_dir >$null 2>&1 + Update-Php $php_dir $status = "Updated to" } else { $status = "Found" @@ -434,7 +434,7 @@ if($installed.MajorMinorVersion -ne $version) { Write-Error "Could not setup PHP $version" -ErrorAction Stop } if($version -lt "5.5") { - ('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Get-File -Url "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ >$null 2>&1 } + ('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Get-File -Url "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ } } else { $enable_extensions += ('opcache') } diff --git a/src/utils.ts b/src/utils.ts index c42b9310f..72970aa45 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -278,10 +278,10 @@ export async function getExtensionPrefix(extension: string): Promise { export async function suppressOutput(os: string): Promise { switch (os) { case 'win32': - return ' >$null 2>&1'; + return ' '; case 'linux': case 'darwin': - return ' >/dev/null 2>&1'; + return ' '; default: return await log('Platform ' + os + ' is not supported', os, 'error'); }