1
0
This commit is contained in:
Jeff Lance 2024-08-03 17:38:17 +02:00
parent 66980f428f
commit 1f0d5fd3dc

View File

@ -15,13 +15,13 @@ err() {
# Function to determine the package manager if not specified # Function to determine the package manager if not specified
determine_package_manager() { determine_package_manager() {
if [ command -v apt-get &>/dev/null ]; then if [ $(command -v apt-get) ]; then
echo "apt" echo "apt"
elif [ command -v pamac &>/dev/null ]; then elif [ $(command -v pamac) ]; then
echo "pamac" echo "pamac"
elif [ command -v yay &>/dev/null ]; then elif [ $(command -v yay) ]; then
echo "yay" echo "yay"
elif [ command -v pacman &>/dev/null ]; then elif [ $(command -v pacman) ]; then
echo "pacman" echo "pacman"
else else
err "No supported package manager found." err "No supported package manager found."
@ -94,25 +94,25 @@ update_system() {
case "${package_manager}" in case "${package_manager}" in
apt) apt)
sudo -E apt update -qq && sudo -E apt upgrade --yes -qq || { sudo -E apt update -qq && sudo -E apt upgrade --yes -qq || {
err "Installation failed." err "Update failed."
exit 1 exit 1
} }
;; ;;
pacman) pacman)
sudo pacman -Syu --noconfirm --removemake --quiet || { sudo pacman -Syu --noconfirm --removemake --quiet || {
err "Installation failed." err "Update failed."
exit 1 exit 1
} }
;; ;;
pamac) pamac)
sudo pamac update --aur --no-confirm && sudo pamac upgrade --aur --no-confirm || { sudo pamac update --aur --no-confirm && sudo pamac upgrade --aur --no-confirm || {
err "Installation failed." err "Update failed."
exit 1 exit 1
} }
;; ;;
yay) yay)
yay -Syu --noconfirm --removemake --quiet || { yay -Syu --noconfirm --removemake --quiet || {
err "Installation failed." err "Update failed."
exit 1 exit 1
} }
;; ;;