-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_after_01-update-env.sh.tmpl
59 lines (45 loc) · 1.65 KB
/
run_after_01-update-env.sh.tmpl
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
#!/bin/bash
# include global vars and functions
source "${INCLUDES}"
{{ if eq .osid "darwin" -}}
# do brew maintenance
if bdb_ask "Do you want to remove extra formulae"; then
# remove extra formulae
brew bundle cleanup -f --file=.config/homebrew/brewfile
# remove dead dependencies
brew autoremove
# empty cache
brew cleanup --prune=all
fi
# update homebrew and installed formulae
bdb_command "Upgrading Homebrew formulae"
brew update && brew upgrade
bdb_success "upgrading Homebrew formulae"
{{ else if eq .osid "windows" -}}
{{ else if or (eq .osid "linux-debian") (eq .osid "linux-ubuntu") -}}
# Upgrade APT packages
bdb_command "Running package maintenance"
sudo -- bash -c 'apt update && apt full-upgrade -y && apt autoremove --purge -y && apt clean -y'
bdb_success "running package maintenance"
# Upgrade Chezmoi
bdb_command "Upgrading Chezmoi"
chezmoi upgrade
bdb_success "upgrading Chezmoi"
{{ else if eq .osid "linux-arch" -}}
bdb_command "Running package maintenance"
sudo -- bash -c 'pacman -Syu --noconfirm && pacman -Qdtq --noconfirm | ifne pacman -Rns --noconfirm - && pacman -Scc --noconfirm'
bdb_success "running package maintenance"
{{ else if eq .osid "linux-fedora" -}}
{{ end -}}
# update zsh plugins
bdb_command "Upgrading Antigen"
antigen_dir="${HOME}/.antigen"
[[ -d "${antigen_dir}" ]] && rm -rf "${antigen_dir}"
mkdir -p "${antigen_dir}"
git clone https://github.com/zsh-users/antigen.git "${antigen_dir}"
bdb_success "upgrading Antigen"
# update vim plugins
bdb_command "Upgrading Vim plugins"
vim -es -u "${HOME}"/.vimrc -i NONE -c "PlugUpdate" -c "qa"
#vim -c PlugUpdate -c qa
bdb_success "upgrading Vim plugins"