From 9ed6fd563560f6b1f89d962c5f52f671bdd2b88c Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Sun, 3 Nov 2024 19:33:18 +0530 Subject: [PATCH] chore: update scripts, add common-service-script to shellcheckrc --- .shellcheckrc | 3 ++- core/tabs/applications-setup/browsers/librewolf.sh | 10 +++------- core/tabs/applications-setup/browsers/waterfox.sh | 6 +++--- .../communication-apps/jitsi-setup.sh | 6 +++++- core/tabs/applications-setup/linutil-installer.sh | 3 ++- core/tabs/applications-setup/linutil-updater.sh | 2 ++ core/tabs/system-setup/global-theme.sh | 8 -------- core/tabs/system-setup/system-update.sh | 1 - core/tabs/utils/create-bootable-usb.sh | 3 +++ core/tabs/utils/samba-ssh-setup.sh | 2 +- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.shellcheckrc b/.shellcheckrc index 0b882066..6bf273ee 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1,2 +1,3 @@ external-sources=true -source=core/tabs/common-script.sh \ No newline at end of file +source=core/tabs/common-script.sh +source=core/tabs/common-service-script.sh \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/librewolf.sh b/core/tabs/applications-setup/browsers/librewolf.sh index 5562954e..d8ed06b4 100644 --- a/core/tabs/applications-setup/browsers/librewolf.sh +++ b/core/tabs/applications-setup/browsers/librewolf.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installLibreWolf() { - if ! command_exists librewolf; then + if ! command_exists io.gitlab.librewolf-community && ! command_exists librewolf; then printf "%b\n" "${YELLOW}Installing Librewolf...${RC}" case "$PACKAGER" in apt-get|nala) @@ -33,12 +33,8 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/ "$AUR_HELPER" -S --needed --noconfirm librewolf-bin ;; apk) - alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2) - if [ "$alpine_version" -le 20 ]; then - printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}" - exit 1 - fi - "$ESCALATION_TOOL" "$PACKAGER" add librewolf + checkFlatpak + flatpak install flathub io.gitlab.librewolf-community ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" diff --git a/core/tabs/applications-setup/browsers/waterfox.sh b/core/tabs/applications-setup/browsers/waterfox.sh index 3cef5106..28ec96dc 100644 --- a/core/tabs/applications-setup/browsers/waterfox.sh +++ b/core/tabs/applications-setup/browsers/waterfox.sh @@ -3,14 +3,14 @@ . ../../common-script.sh installWaterfox() { - if ! command_exists waterfox; then + if ! command_exists net.waterfox.waterfox && ! command_exists waterfox; then printf "%b\n" "${YELLOW}Installing waterfox...${RC}" case "$PACKAGER" in pacman) - "$AUR_HELPER" -S --needed --noconfirm waterfox-bin + "$AUR_HELPER" -S --needed --noconfirm waterfox-bin ;; *) - . ../setup-flatpak.sh + checkFlatpak flatpak install -y flathub net.waterfox.waterfox ;; esac diff --git a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh index 2b6b4bbe..f6f2f200 100644 --- a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh +++ b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installJitsi() { - if ! command_exists jitsi-meet; then + if ! command_exists org.jitsi.jitsi-meet && ! command_exists jitsi-meet; then printf "%b\n" "${YELLOW}Installing Jitsi meet...${RC}" case "$PACKAGER" in apt-get|nala) @@ -21,6 +21,10 @@ installJitsi() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet ;; + apk) + checkFlatpak + flatpak install flathub org.jitsi.jitsi-meet + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/linutil-installer.sh b/core/tabs/applications-setup/linutil-installer.sh index 0531ca03..7b02af7c 100755 --- a/core/tabs/applications-setup/linutil-installer.sh +++ b/core/tabs/applications-setup/linutil-installer.sh @@ -49,7 +49,8 @@ installLinutil() { "$ESCALATION_TOOL" "$PACKAGER" add build-base "$ESCALATION_TOOL" "$PACKAGER" add rustup rustup-init - . $HOME/.cargo/env + # shellcheck disable=SC1091 + . "$HOME/.cargo/env" ;; *) curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/core/tabs/applications-setup/linutil-updater.sh b/core/tabs/applications-setup/linutil-updater.sh index b07219c9..4e399a02 100755 --- a/core/tabs/applications-setup/linutil-updater.sh +++ b/core/tabs/applications-setup/linutil-updater.sh @@ -23,6 +23,8 @@ updateLinutil() { "$ESCALATION_TOOL" "$PACKAGER" add build-base "$ESCALATION_TOOL" "$PACKAGER" add rustup rustup-init + # shellcheck disable=SC1091 + . "$HOME/.cargo/env" ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y rustup diff --git a/core/tabs/system-setup/global-theme.sh b/core/tabs/system-setup/global-theme.sh index 1acf7c93..07f9d4b2 100755 --- a/core/tabs/system-setup/global-theme.sh +++ b/core/tabs/system-setup/global-theme.sh @@ -17,14 +17,6 @@ install_theme_tools() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum ;; - apk) - alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2) - if [ "$alpine_version" -le 20 ]; then - printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}" - exit 1 - fi - "$ESCALATION_TOOL" "$PACKAGER" add qt6ct kvantum - ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/system-setup/system-update.sh b/core/tabs/system-setup/system-update.sh index dba75ebb..53f3a1df 100755 --- a/core/tabs/system-setup/system-update.sh +++ b/core/tabs/system-setup/system-update.sh @@ -78,7 +78,6 @@ updateSystem() { "$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup ;; apk) - "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" upgrade ;; *) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index f05830d3..09b24d4d 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -12,6 +12,7 @@ list_devices() { printf "\n" } +# shellcheck disable=SC2086 installDependencies() { DEPENDENCIES="xz gzip bzip2 jq" if ! command_exists ${DEPENDENCIES}; then @@ -23,6 +24,8 @@ installDependencies() { "${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES};; pacman) "${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES};; + apk) + "${ESCALATION_TOOL}" "${PACKAGER}" add ${DEPENDENCIES};; *) printf "%b\n" "${RED}Unsupported package manager.${RC}" exit 1 diff --git a/core/tabs/utils/samba-ssh-setup.sh b/core/tabs/utils/samba-ssh-setup.sh index 76b5f48e..aa0dc30e 100755 --- a/core/tabs/utils/samba-ssh-setup.sh +++ b/core/tabs/utils/samba-ssh-setup.sh @@ -12,7 +12,7 @@ install_package() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE" ;; apk) - "$ESCALATION_TOOL" "$PACKAGER" add $PACKAGE + "$ESCALATION_TOOL" "$PACKAGER" add "$PACKAGE" ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"