diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-08-25 08:09:21 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-08-25 08:09:21 +0200 |
| commit | b0e1966d43575ce82aeef03560c33df0831ac976 (patch) | |
| tree | 1adbd6a85e55370099eb6d415d6f19fa972cc29b /zsh | |
| parent | c1b5efa4349bdf7b8b57663b260678dfadac62e8 (diff) | |
| download | dotfiles-b0e1966d43575ce82aeef03560c33df0831ac976.tar.gz dotfiles-b0e1966d43575ce82aeef03560c33df0831ac976.tar.bz2 dotfiles-b0e1966d43575ce82aeef03560c33df0831ac976.zip | |
zsh: feinere update-funktionen
Diffstat (limited to 'zsh')
| -rw-r--r-- | zsh/zshrc | 37 |
1 files changed, 33 insertions, 4 deletions
| @@ -80,11 +80,40 @@ alias pwgen='pwgen -s 48 1' | |||
| 80 | alias ls='ls -G' | 80 | alias ls='ls -G' |
| 81 | 81 | ||
| 82 | # Funktionen | 82 | # Funktionen |
| 83 | npm-update() { | ||
| 84 | if (($+commands[npm])); then | ||
| 85 | npm update -g --loglevel=info | ||
| 86 | fi | ||
| 87 | } | ||
| 88 | |||
| 83 | nvim-update() { | 89 | nvim-update() { |
| 84 | nvim --headless \ | 90 | if (($+commands[nvim])); then |
| 85 | -c "lua require[[lazy]].sync({ wait = true })" \ | 91 | nvim --headless \ |
| 86 | -c "UpdateParsers" \ | 92 | -c "lua require[[lazy]].sync({ wait = true })" \ |
| 87 | -c "qa" | 93 | -c "UpdateParsers" \ |
| 94 | -c "qa" | ||
| 95 | fi | ||
| 96 | } | ||
| 97 | |||
| 98 | pkg-update() { | ||
| 99 | case "$OSTYPE" in | ||
| 100 | darwin*) | ||
| 101 | brew update && brew upgrade | ||
| 102 | ;; | ||
| 103 | freebsd*) | ||
| 104 | doas pkg update && doas pkg upgrade | ||
| 105 | ;; | ||
| 106 | *) | ||
| 107 | print -u2 "pkg-update: kein Paketmanager fuer $OSTYPE hinterlegt" | ||
| 108 | return 1 | ||
| 109 | ;; | ||
| 110 | esac | ||
| 111 | } | ||
| 112 | |||
| 113 | system-update() { | ||
| 114 | npm-update || return | ||
| 115 | nvim-update || return | ||
| 116 | pkg-update | ||
| 88 | } | 117 | } |
| 89 | 118 | ||
| 90 | # Command completion | 119 | # Command completion |
