-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpost-exec.sh
executable file
·49 lines (37 loc) · 1.05 KB
/
post-exec.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
#!/usr/bin/env bash
#
# Post Execution Script
#
set -o pipefail
SCRIPTNAME=$(basename "$0")
USERNAME=$(whoami)
info () {
printf "\r [ \033[00;34m..\033[0m ] %s\n" "$1"
}
user () {
printf "\r [ \033[0;33m??\033[0m ] %s\n" "$1"
}
success () {
printf "\r\033[2K [ \033[00;32mOK\033[0m ] %s\n" "$1"
}
fail () {
printf "\r\033[2K [\033[0;31mFAIL\033[0m] %s\n" "$1"
echo ''
exit
}
info "$SCRIPTNAME (USER/ID: $USERNAME/$UID) launched"
info "Updating locate database"
sudo updatedb || fail "Updating locate database"
if [ -r ../requirements.yml ];then
info "Installing ansible-galaxy dependencies"
ansible-galaxy install -r requirements.yml --force
fi
if [ ! -r ~/.config/nvim ];then
info "Installing nvchad"
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1
fi
if [ ! -r ~/.config/nvim/lua/custom ];then
info "Cloning custom nvchad config"
git clone https://github.com/stormmurdoc/nvchad-custom-config ~/.config/nvim/lua/custom --depth 1
fi
success "$SCRIPTNAME (USER/ID: $USERNAME/$UID) completed with RC:$?"