From ab176c51b203e31e7c1e0c935cd8d304541d44d9 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Wed, 6 May 2020 08:59:48 +0200 Subject: [PATCH] Solved shellcheck hints --- scripts/client/setup.sh | 12 ++++++------ scripts/data/import-from-system.sh | 1 + scripts/image/backup.sh | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/client/setup.sh b/scripts/client/setup.sh index 6a3ee0a..75fcf7d 100644 --- a/scripts/client/setup.sh +++ b/scripts/client/setup.sh @@ -18,7 +18,7 @@ get_packages "general" "client/pacman/general" "client/pacman/games" | sudo pacm info "Synchronizing yay packages..." for package in $(get_packages "client/yay/general"); do - if [ "$(pacman -Qi $package 2> /dev/null)" ]; then + if [ "$(pacman -Qi "$package" 2> /dev/null)" ]; then info "Package \"$package\" is allready installed. Skipped installation." else info "Install package \"$package\" with yay..." @@ -116,26 +116,26 @@ install_gnome_extension(){ fi else info "Install..." && - git clone $2 "$extension_folder" || error "Failed." + git clone "$2" "$extension_folder" || error "Failed." fi if [ -f "$extension_folder""Makefile" ]; then tmp_extension_folder="/tmp/$1" - mv $extension_folder $tmp_extension_folder + mv "$extension_folder" "$tmp_extension_folder" info "Compilling extension.." - (cd $tmp_extension_folder && make install) || error "Compilation with failed." + (cd "$tmp_extension_folder" && make install) || error "Compilation with failed." info "Cleaning up tmp-extension folder..."&& - rm -fr $tmp_extension_folder || error "Failed." + rm -fr "$tmp_extension_folder" || error "Failed." else info "No Makefile found. Skipping compilation..." fi info "Activating GNOME extension \"$1\"..." && - gnome-extensions enable $1 || error "Failed." + gnome-extensions enable "$1" || error "Failed." } if [ "$DESKTOP_SESSION" == "gnome" ]; then diff --git a/scripts/data/import-from-system.sh b/scripts/data/import-from-system.sh index fe7c339..ceff01c 100644 --- a/scripts/data/import-from-system.sh +++ b/scripts/data/import-from-system.sh @@ -5,6 +5,7 @@ # # shellcheck source=/dev/null # Deactivate SC1090 # shellcheck disable=SC2143 # Comparing with -z allowed +# shellcheck disable=SC2015 # Deactivating bool hint source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) if [ -z "$(mount | grep "$DECRYPTED_PATH")" ] then diff --git a/scripts/image/backup.sh b/scripts/image/backup.sh index f9171ef..72b1b9e 100644 --- a/scripts/image/backup.sh +++ b/scripts/image/backup.sh @@ -5,11 +5,11 @@ info "Actual mounted devices:" echo ls -lasi /dev/ | grep -E "sd|mm" echo -while [ \! -b "$ifi" ] +while [ ! -b "$ifi" ] do info "Please select the correct device." question "/dev/:" - read device + read -r device ifi="/dev/$device" done while [ "$path" == "" ]