dotfiles/scripts/.local/bin/update.sh

21 lines
707 B
Bash
Raw Normal View History

2022-03-06 15:22:37 +00:00
#!/usr/bin/env dash
2022-01-23 18:26:28 +00:00
if [ "$(uname -o)" = "Android" ]; then
pkg upgrade
elif [ "$(uname -o)" = "GNU/Linux" ]; then
[ "$(lsb_release -si)" = "Artix" ] && paru
[ "$(lsb_release -si)" = "Fedora" ] && sudo dnf upgrade
if [ "$(lsb_release -si)" = "Debian" ] || [ "$(lsb_release -si)" = "Ubuntu" ]; then
sudo apt update
echo
sudo apt full-upgrade --purge
echo
sudo apt autoremove --purge --yes
fi
2022-01-23 18:26:28 +00:00
fi
command -v flatpak >/dev/null 2>&1 && { echo; flatpak update; }
command -v docker >/dev/null 2>&1 && { echo; docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' | xargs -l docker pull; }
command -v npm >/dev/null 2>&1 && { echo; npm up -g; }