-
Notifications
You must be signed in to change notification settings - Fork 1
/
apply-changes
executable file
·36 lines (29 loc) · 1.02 KB
/
apply-changes
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
# apply-changes v0.1
# git post-merge hook to apply changes to the running environment after merging
# from remote, attempts to re-run post-install scripts that have changed
restart_x() {
printf '\e[1m%s\e[0m\n' 'Restart X session to apply changes to graphical shell'
}
relogin() {
printf '\e[1m%s\e[0m\n' 'Login again to apply changes to shell environment.'
}
IFS='
'
! is-termux && git meta diff-tree -r --name-only ORIG_HEAD HEAD \
| while read -r file; do
case "$file" in
# changes to graphical shell
.local/include/*|.config/dwm/*) ~/.once.d/10-git-upstream.sh; restart_x;;
.config/*|.xinitrc|.xresources|Scripts/*) restart_x;;
# changes to shell environment
.profile) relogin;;
# changes to installed packages
.comforts) yes n | ~/.once.d/01-install-essential.sh;;
.comforts-git|.config/upstream/*) ~/.once.d/10-git-upstream.sh;;
# changes to keyd
.config/keyd/*) sudo systemctl restart keyd.service;;
# changes to post-install scripts
.once.d/*) "$file";;
esac
done
git meta diff --stat ORIG_HEAD..HEAD