2024-02-19 21:07:46 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-04-28 08:24:52 -04:00
|
|
|
## Here be dragons
|
|
|
|
# If paru is installed this script will update an Arch or Arch-based system,
|
|
|
|
# including AUR packages, without asking for confirmation. Never use it if you
|
|
|
|
# don't know how it will impact your system. For more information on safely
|
|
|
|
# updating see: https://wiki.archlinux.org/title/System_maintenance#Upgrading_the_system
|
|
|
|
|
2024-03-25 21:56:18 -04:00
|
|
|
alias paru='paru --noconfirm --skipreview'
|
2024-02-19 21:07:46 -05:00
|
|
|
alias zigup='zigup --install-dir "${HOME}/.local/share/zigup" --path-link "${HOME}/.local/bin/zig"'
|
|
|
|
|
|
|
|
updates=$(checkupdates)
|
|
|
|
aur_updates=$(paru -Qua)
|
2024-10-06 00:48:23 -04:00
|
|
|
rust_has_update=$(rustup check | grep -c 'Update')
|
2024-02-19 21:07:46 -05:00
|
|
|
|
2024-10-06 00:48:23 -04:00
|
|
|
if [ "$updates" = "" ] \
|
|
|
|
&& [ "$aur_updates" = "" ] \
|
|
|
|
&& [ "$rust_has_update" -eq 0 ];
|
|
|
|
then
|
2024-02-19 21:07:46 -05:00
|
|
|
echo "System is already up to date."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
river_has_update=$(echo "$aur_updates" | grep -c 'river-git')
|
|
|
|
zls_has_update=$(echo "$aur_updates" | grep -c 'zls-git')
|
|
|
|
|
2024-10-06 00:48:23 -04:00
|
|
|
|
|
|
|
if [ "$rust_has_update" -ne 0 ]; then
|
|
|
|
rustup update
|
|
|
|
fi
|
|
|
|
|
2024-02-19 21:07:46 -05:00
|
|
|
if [ "$river_has_update" -ne 0 ] && [ "$zls_has_update" -ne 0 ]; then
|
2024-06-08 07:10:34 -04:00
|
|
|
zigup 0.13.0
|
2024-07-09 08:58:25 -04:00
|
|
|
paru -Syu river-git --ignore zls-git
|
2024-02-19 21:07:46 -05:00
|
|
|
zigup master
|
2024-03-25 21:56:18 -04:00
|
|
|
paru -S zls-git
|
2024-02-19 21:07:46 -05:00
|
|
|
elif [ "$river_has_update" -ne 0 ]; then
|
2024-06-08 07:10:34 -04:00
|
|
|
zigup 0.13.0
|
2024-02-19 21:07:46 -05:00
|
|
|
paru -Syu
|
|
|
|
zigup master
|
|
|
|
else
|
|
|
|
zigup master
|
|
|
|
paru -Syu
|
|
|
|
fi
|