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

21 lines
740 B
Bash
Executable file

#!/usr/bin/env dash
[ "$(lsb_release -si)" = "Artix" ] && paru
[ "$(lsb_release -si)" = "Fedora" ] && sudo dnf upgrade
echo
command -v flatpak >/dev/null 2>&1 &&
{ flatpak update; echo; }
command -v npm >/dev/null 2>&1 &&
{ npm update --location="global"; echo; }
command -v rustup >/dev/null 2>&1 &&
{ rustup update; echo; }
command -v nvim >/dev/null 2>&1 &&
{ nvim --headless +PlugUpdate +PlugUpgrade +qa; echo; }
command -v docker >/dev/null 2>&1 && [ "$(sudo docker images | wc -l)" -gt 1 ] &&
{ sudo sh -c "docker images |
awk '(NR>1) && (\$2!~/none/) {print \$1\":\"\$2}' |
xargs -l docker pull"; echo; }
zsh -ic "antidote update && echo && git -C $(dirname -- "$(readlink -e "$0")") pull"