From 64570aed40cfa3dfd293715ebe4e5d1232751022 Mon Sep 17 00:00:00 2001 From: fiftydinar <65243233+fiftydinar@users.noreply.github.com> Date: Mon, 27 May 2024 10:41:42 +0200 Subject: [PATCH] fix(gnome-extensions): There is no need to use echo when bash substitution exists Thanks to ShellCheck --- modules/gnome-extensions/gnome-extensions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gnome-extensions/gnome-extensions.sh b/modules/gnome-extensions/gnome-extensions.sh index d50a97b..8640d3c 100644 --- a/modules/gnome-extensions/gnome-extensions.sh +++ b/modules/gnome-extensions/gnome-extensions.sh @@ -106,7 +106,7 @@ fi if [[ ${#INSTALL[@]} -gt 0 ]] && ! "${LEGACY}"; then for INSTALL_EXT in "${INSTALL[@]}"; do # Replaces whitespaces with %20 for install entries which contain extension name, since URLs can't contain whitespace - WHITESPACE_HTML=$(echo "${INSTALL_EXT// /%20}") + WHITESPACE_HTML="${INSTALL_EXT// /%20}" URL_QUERY=$(curl -s "https://extensions.gnome.org/extension-query/?search=${WHITESPACE_HTML}") QUERIED_EXT=$(echo "${URL_QUERY}" | yq ".extensions[] | select(.name == \"${INSTALL_EXT}\")") if [[ -z "${QUERIED_EXT}" ]]; then @@ -171,7 +171,7 @@ if [[ ${#UNINSTALL[@]} -gt 0 ]]; then for UNINSTALL_EXT in "${UNINSTALL[@]}"; do # Replaces whitespaces with %20 for install entries which contain extension name, since URLs can't contain whitespace # Getting json query from the website is useful to intuitively uninstall the extension without need to manually input UUID - WHITESPACE_HTML=$(echo "${UNINSTALL_EXT// /%20}") + WHITESPACE_HTML="${UNINSTALL_EXT// /%20}" URL_QUERY=$(curl -s "https://extensions.gnome.org/extension-query/?search=${WHITESPACE_HTML}") QUERIED_EXT=$(echo "${URL_QUERY}" | yq ".extensions[] | select(.name == \"${UNINSTALL_EXT}\")") if [[ -z "${QUERIED_EXT}" ]]; then