From 537c66b2ea38930f515d498d6cf20cb7c5c1b1ff Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 8 Oct 2020 17:27:52 +0530 Subject: [PATCH] Minor fixes in scripts --- src/scripts/darwin.sh | 4 ++-- src/scripts/linux.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 8ea96ebc..8e69a7a2 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -67,7 +67,7 @@ check_extension() { fi } -# Fuction to get the PECL version. +# Function to get the PECL version. get_pecl_version() { extension=$1 stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot)")" @@ -224,7 +224,7 @@ add_composertool() { prefix=$3 ( composer global require "$prefix$release" >/dev/null 2>&1 && - json=$(grep "$prefix$tool" /Users/$USER/.composer/composer.json) && + json=$(grep "$prefix$tool" /Users/"$USER"/.composer/composer.json) && tool_version=$(get_tool_version 'echo' "$json") && add_log "$tick" "$tool" "Added $tool $tool_version" ) || add_log "$cross" "$tool" "Could not setup $tool" diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 5cb24ef6..d336abf2 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -42,7 +42,7 @@ cleanup_lists() { sudo mkdir /etc/apt/sources.list.d sudo mv /etc/apt/sources.list.d.save/*ondrej*.list /etc/apt/sources.list.d/ sudo mv /etc/apt/sources.list.d.save/*dotdeb*.list /etc/apt/sources.list.d/ 2>/dev/null || true - trap "sudo mv /etc/apt/sources.list.d.save/*.list /etc/apt/sources.list.d/" exit + trap "sudo mv /etc/apt/sources.list.d.save/*.list /etc/apt/sources.list.d/ 2>/dev/null" exit fi } @@ -89,7 +89,7 @@ configure_pecl() { fi } -# Fuction to get the PECL version of an extension. +# Function to get the PECL version of an extension. get_pecl_version() { extension=$1 stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot)")" @@ -153,7 +153,7 @@ enable_extension() { fi } -# Funcion to add PDO extension. +# Function to add PDO extension. add_pdo_extension() { pdo_ext="pdo_$1" if check_extension "$pdo_ext"; then @@ -322,7 +322,7 @@ add_composertool() { prefix=$3 ( composer global require "$prefix$release" >/dev/null 2>&1 && - json=$(grep "$prefix$tool" /home/$USER/.composer/composer.json) && + json=$(grep "$prefix$tool" /home/"$USER"/.composer/composer.json) && tool_version=$(get_tool_version 'echo' "$json") && add_log "$tick" "$tool" "Added $tool $tool_version" ) || add_log "$cross" "$tool" "Could not setup $tool"