diff --git a/coreupdate b/coreupdate index baed09d..c10bc0a 100755 --- a/coreupdate +++ b/coreupdate @@ -20,65 +20,16 @@ EOF clear print_logo +COREDESKTOP="$HOME/.local/share/coredesktop" + echo "Updating CoreDesktop..." -git -C ~/.local/share/coredesktop pull -sudo cp ~/.local/share/coredesktop/coreupdate ~/.local/bin/coreupdate -sudo cp ~/.local/share/coredesktop/corerefresh ~/.local/bin/corerefresh +git -C "$COREDESKTOP" pull +mkdir -p "$COREDESKTOP/updates.d" +sudo cp "$COREDESKTOP/coreupdate" ~/.local/bin/coreupdate +sudo cp "$COREDESKTOP/corerefresh" ~/.local/bin/corerefresh -echo "Updating Arch..." -sudo pacman -Syu - -cd ~/.local/share/coredesktop -source utils.sh -source packages.conf -source remove-packages.conf - -echo "Removing unwanted packages..." -remove_packages "${REMOVE_PACMAN[@]}" -remove_flatpaks "${REMOVE_FLATPAKS[@]}" - -echo "Checking for new packages..." -install_packages "${SYSTEM_UTILS[@]}" -install_packages "${DEV_TOOLS[@]}" -install_packages "${MAINTENANCE[@]}" -install_packages "${DESKTOP[@]}" -install_packages "${MEDIA[@]}" -install_packages "${FONTS[@]}" - -echo "Updating AUR..." - -YAY_FLAGS="--noconfirm --answerdiff=None --answeredit=None --answerclean=None" - -if ! yay -Sua $YAY_FLAGS 2>/dev/null; then - echo "yay -Sua returned an error. Let's rebuild YAY." - sudo pacman -R yay - cd /tmp - git clone https://aur.archlinux.org/yay.git - cd yay - makepkg -si - cd .. - rm -rf yay - cd - yay -Sua $YAY_FLAGS -else - echo "AUR up to date." -fi - -echo "Updating Flatpaks..." -flatpak update - -echo "Updating Ruby and Rails..." -mise upgrade --bump ruby -mise reshim -gem update - -echo "Checking for new flatpaks..." -. install-flatpaks.sh - -echo "Configuring Bitwarden SSH agent..." -. bitwarden.sh - -echo "Update pipx applications..." -pipx upgrade-all +for plugin in "$COREDESKTOP/updates.d/"*.sh; do + [ -f "$plugin" ] && source "$plugin" +done echo "Done." diff --git a/updates.d/10-pacman.sh b/updates.d/10-pacman.sh new file mode 100644 index 0000000..4b14672 --- /dev/null +++ b/updates.d/10-pacman.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +COREDESKTOP="$HOME/.local/share/coredesktop" + +echo "Updating Arch..." +sudo pacman -Syu + +source "$COREDESKTOP/utils.sh" +source "$COREDESKTOP/packages.conf" +source "$COREDESKTOP/remove-packages.conf" + +echo "Removing unwanted packages..." +remove_packages "${REMOVE_PACMAN[@]}" +remove_flatpaks "${REMOVE_FLATPAKS[@]}" + +echo "Checking for new packages..." +install_packages "${SYSTEM_UTILS[@]}" +install_packages "${DEV_TOOLS[@]}" +install_packages "${MAINTENANCE[@]}" +install_packages "${DESKTOP[@]}" +install_packages "${MEDIA[@]}" +install_packages "${FONTS[@]}" diff --git a/updates.d/20-aur.sh b/updates.d/20-aur.sh new file mode 100644 index 0000000..346806f --- /dev/null +++ b/updates.d/20-aur.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +echo "Updating AUR..." + +YAY_FLAGS="--noconfirm --answerdiff=None --answeredit=None --answerclean=None" + +if ! yay -Sua $YAY_FLAGS 2>/dev/null; then + echo "yay -Sua returned an error. Let's rebuild YAY." + sudo pacman -R yay + cd /tmp + git clone https://aur.archlinux.org/yay.git + cd yay + makepkg -si + cd .. + rm -rf yay + cd + yay -Sua $YAY_FLAGS +else + echo "AUR up to date." +fi diff --git a/updates.d/30-flatpak.sh b/updates.d/30-flatpak.sh new file mode 100644 index 0000000..a4769a4 --- /dev/null +++ b/updates.d/30-flatpak.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +COREDESKTOP="$HOME/.local/share/coredesktop" + +echo "Updating Flatpaks..." +flatpak update --noninteractive + +echo "Checking for new flatpaks..." +. "$COREDESKTOP/install-flatpaks.sh" diff --git a/updates.d/40-ruby.sh b/updates.d/40-ruby.sh new file mode 100644 index 0000000..d67de20 --- /dev/null +++ b/updates.d/40-ruby.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +echo "Updating Ruby and Rails..." +mise upgrade --bump ruby +mise reshim +gem update diff --git a/updates.d/50-bitwarden.sh b/updates.d/50-bitwarden.sh new file mode 100644 index 0000000..ea0d19a --- /dev/null +++ b/updates.d/50-bitwarden.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +COREDESKTOP="$HOME/.local/share/coredesktop" + +echo "Configuring Bitwarden SSH agent..." +. "$COREDESKTOP/bitwarden.sh" diff --git a/updates.d/60-pipx.sh b/updates.d/60-pipx.sh new file mode 100644 index 0000000..b6f0366 --- /dev/null +++ b/updates.d/60-pipx.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Updating pipx applications..." +pipx upgrade-all