Skip to content

Commit 1fe60f5

Browse files
committed
refact: fix (almost) all shellcheck errors
the only files i didn't fix: - core/tabs/utils/ssh.sh (ref #996) - core/tabs/system-setup/arch/server-setup.sh
1 parent d91a44e commit 1fe60f5

25 files changed

+80
-74
lines changed

core/tabs/applications-setup/android-debloat.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install_adb() {
1919
"$ESCALATION_TOOL" "$PACKAGER" add android-tools
2020
;;
2121
*)
22-
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
22+
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}"
2323
exit 1
2424
;;
2525
esac

core/tabs/applications-setup/browsers/librewolf.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ installLibreWolf() {
88
case "$PACKAGER" in
99
apt-get|nala)
1010
"$ESCALATION_TOOL" "$PACKAGER" install -y gnupg lsb-release apt-transport-https ca-certificates
11-
distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi`
11+
distro=$(if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q "$(lsb_release -sc)"; then "$(lsb_release -sc)"; else echo 'focal'; fi)
1212
curl -fsSL https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg
1313
echo "Types: deb
1414
URIs: https://deb.librewolf.net
@@ -49,4 +49,4 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/
4949
checkEnv
5050
checkEscalationTool
5151
checkAURHelper
52-
installLibreWolf
52+
installLibreWolf

core/tabs/applications-setup/communication-apps/discord-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ installDiscord() {
1717
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm discord
1818
;;
1919
dnf)
20-
"$ESCALATION_TOOL" "$PACKAGER" install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
20+
"$ESCALATION_TOOL" "$PACKAGER" install -y "https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
2121
"$ESCALATION_TOOL" "$PACKAGER" install -y discord
2222
;;
2323
apk)
@@ -36,4 +36,4 @@ installDiscord() {
3636

3737
checkEnv
3838
checkEscalationTool
39-
installDiscord
39+
installDiscord

core/tabs/applications-setup/communication-apps/signal-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ installSignal() {
88
case "$PACKAGER" in
99
apt-get|nala)
1010
curl -fsSL https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg
11-
cat signal-desktop-keyring.gpg | "$ESCALATION_TOOL" tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null
11+
"$ESCALATION_TOOL" tee /usr/share/keyrings/signal-desktop-keyring.gpg < signal-desktop-keyring.gpg > /dev/null
1212
printf "%b\n" 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/signal-xenial.list
1313
"$ESCALATION_TOOL" "$PACKAGER" update
1414
"$ESCALATION_TOOL" "$PACKAGER" -y install signal-desktop
@@ -39,4 +39,4 @@ installSignal() {
3939

4040
checkEnv
4141
checkEscalationTool
42-
installSignal
42+
installSignal

core/tabs/applications-setup/dwmtitus-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ setupDisplayManager() {
192192
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-xinit xorg-x11-server-Xorg
193193
;;
194194
*)
195-
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
195+
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}"
196196
exit 1
197197
;;
198198
esac
@@ -244,7 +244,7 @@ setupDisplayManager() {
244244
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
245245
;;
246246
*)
247-
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
247+
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}"
248248
exit 1
249249
;;
250250
esac

core/tabs/applications-setup/linutil-installer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ installLinutil() {
5353
;;
5454
*)
5555
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
56-
. $HOME/.cargo/env
56+
. "$HOME/.cargo/env"
5757
;;
5858
esac
5959
fi

core/tabs/applications-setup/linutil-updater.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ updateLinutil() {
1717
zypper)
1818
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
1919
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
20-
. $HOME/.cargo/env
20+
. "$HOME/.cargo/env"
2121
;;
2222
apk)
2323
"$ESCALATION_TOOL" "$PACKAGER" add build-base

core/tabs/system-setup/arch/server-setup.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ select_option() {
102102
;;
103103
'[B') # Down arrow
104104
((selected++))
105-
if [ $selected -ge $num_options ]; then
105+
if [ $selected -ge "$num_options" ]; then
106106
selected=0
107107
fi
108108
;;
@@ -183,6 +183,7 @@ keymap () {
183183
echo -ne "
184184
Please select key board layout from this list"
185185
# These are default key maps as presented in official arch repo archinstall
186+
# shellcheck disable=SC1010
186187
options=(us by ca cf cz de dk es et fa fi fr gr hu il it lt lv mk nl no pl ro ru se sg ua uk)
187188

188189
select_option "${options[@]}"

core/tabs/system-setup/compile-setup.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,38 @@ installDepend() {
1515
else
1616
printf "%b\n" "${GREEN}Multilib is already enabled.${RC}"
1717
fi
18-
"$AUR_HELPER" -S --needed --noconfirm $DEPENDENCIES
18+
"$AUR_HELPER" -S --needed --noconfirm "$DEPENDENCIES"
1919
;;
2020
apt-get|nala)
2121
COMPILEDEPS='build-essential'
2222
"$ESCALATION_TOOL" "$PACKAGER" update
2323
"$ESCALATION_TOOL" dpkg --add-architecture i386
2424
"$ESCALATION_TOOL" "$PACKAGER" update
25-
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS
25+
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" "$COMPILEDEPS"
2626
;;
2727
dnf)
2828
COMPILEDEPS='@development-tools'
2929
"$ESCALATION_TOOL" "$PACKAGER" update
3030
"$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled powertools
31-
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS
31+
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" "$COMPILEDEPS"
3232
"$ESCALATION_TOOL" "$PACKAGER" install -y glibc-devel.i686 libgcc.i686
3333
;;
3434
zypper)
3535
COMPILEDEPS='patterns-devel-base-devel_basis'
3636
"$ESCALATION_TOOL" "$PACKAGER" refresh
37-
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
37+
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install "$DEPENDENCIES" "$COMPILEDEPS"
3838
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
3939
;;
4040
apk)
4141
"$ESCALATION_TOOL" "$PACKAGER" add build-base multitail tar tree trash-cli unzip cmake jq
4242
;;
4343
*)
44-
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
44+
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES"
4545
;;
4646
esac
4747
}
4848

4949
checkEnv
5050
checkAURHelper
5151
checkEscalationTool
52-
installDepend
52+
installDepend

core/tabs/system-setup/system-cleanup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cleanup_system() {
2222
;;
2323
pacman)
2424
"$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm
25-
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null || true
25+
"$ESCALATION_TOOL" "$PACKAGER" -Rns "$(pacman -Qtdq)" --noconfirm > /dev/null || true
2626
;;
2727
apk)
2828
"$ESCALATION_TOOL" "$PACKAGER" cache clean

0 commit comments

Comments
 (0)