-
Notifications
You must be signed in to change notification settings - Fork 5
/
update_deps.sh
executable file
·88 lines (71 loc) · 1.85 KB
/
update_deps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/zsh
if [[ $commands[brew] ]]; then
echo "Updating Homebrew packages"
brew upgrade
if [[ "$OSTYPE" == darwin* ]]; then
brew upgrade --cask
fi
fi
if [[ $commands[antidote] ]]; then
echo "Updating zsh modules"
antidote update
fi
if [[ $commands[update_zsh_direnv] ]]; then
echo "Updating direnv"
update_zsh_direnv
fi
if [[ $commands[pyenv] ]]; then
echo "Updating pyenv"
pyenv update
pyenv versions --bare \
| grep -v "/" \
| xargs -L 1 -I {} bash -c "PYENV_VERSION={} pip install -U pip;PYENV_VERSION={} pip install -U -r ~/.pyenv/default-packages"
fi
if [[ $commands[nvm] ]]; then
echo "Updating nvm"
nvm upgrade
fi
if [[ $commands[rbenv] ]]; then
echo "Updating rbenv"
cd $HOME/.rbenv/
git pull
fi
tpm=$HOME/.tmux/plugins/tpm/bin/update_plugins
if [[ -f $tpm ]]; then
echo "Updating tmux plugins"
$tpm all
fi
if [[ $commands[pipx] ]]; then
echo "Updating packages installed through pipx"
pipx upgrade-all
fi
if [[ "$OSTYPE" == linux* ]]; then
if [[ $commands[nix-env] ]]; then
echo "Updating packages installed through nix-env"
nix-env -u
fi
if [[ $commands[dnf] ]]; then
echo "Updating Fedora packages"
sudo dnf -y upgrade --refresh
fi
if [[ $commands[apt] && ! -L $(which apt) ]]; then
echo "Updating Ubuntu packages"
sudo apt update
sudo apt full-upgrade -y
fi
if [[ $commands[flatpak] ]]; then
echo "Updating flatpack packages"
flatpak -y update
fi
if [[ $commands[snap] ]]; then
echo "Updating snap packages"
sudo snap refresh
fi
if [[ $commands[fwupdmgr] ]]; then
echo "Updating firmware"
sudo fwupdmgr refresh
sudo fwupdmgr update
fi
fi
echo "Updating completion scripts"
./setup_completions.sh