Refine update alias

This commit is contained in:
Marko Korhonen 2022-08-03 09:47:44 +03:00
parent 5acb1dfb07
commit efae4c58c0
No known key found for this signature in database
GPG key ID: 911B85FBC6003FE5

View file

@ -154,10 +154,6 @@ update() {
plugins
}
repo() {
aur sync -Su --margs --noconfirm
}
plugins() {
nvim +PackerSync +TSUpdate
zinit self-update
@ -165,6 +161,11 @@ update() {
$HOME/.tmux/plugins/tpm/bin/update_plugins all
}
{%@@ if profile == "Moria" @@%}
repo() {
aur sync -Su --margs --noconfirm
}
docker-update() {
for dir in $HOME/git/dotfiles/docker/*; do
cd $dir
@ -179,13 +180,12 @@ update() {
docker system prune -af --volumes
}
apt() {
{%@@ endif @@%}
{%@@ if profile == "mko-laptop" @@%}
apt-upd() {
sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y
}
if [ $# -eq 0 ]; then
1=all
fi
{%@@ endif @@%}
case "$1" in
all)
@ -204,18 +204,20 @@ update() {
{%@@ endif @@%}
{%@@ if profile == "mko-laptop" @@%}
apt)
apt
apt-upd
;;
{%@@ endif @@%}
*)
all
{%@@ if profile == "mko-laptop" @@%}
apt-upd
;;
{%@@ else @@%}
paru
;;
{%@@ endif @@%}
esac
}
# remove unneeded packages
autoremove() { sudo pacman -Rns $(pacman -Qdtq) }
# turn on usb tethering on my android phone
tether() { adb shell su -c "service call connectivity 33 i32 1 s16 me" > /dev/null }