From efae4c58c065ba67248d61007e475d99e20672dd Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Wed, 3 Aug 2022 09:47:44 +0300 Subject: [PATCH] Refine update alias --- home/.config/zsh/03-aliases.zsh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/home/.config/zsh/03-aliases.zsh b/home/.config/zsh/03-aliases.zsh index a74e1d7..93a6db8 100644 --- a/home/.config/zsh/03-aliases.zsh +++ b/home/.config/zsh/03-aliases.zsh @@ -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 }