-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandalone_rcup.sh
86 lines (86 loc) · 2.39 KB
/
standalone_rcup.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
#!/bin/sh
#
# Usage:
#
# sh install.sh
#
# Environment variables: VERBOSE, CP, LN, MKDIR, RM, DIRNAME.
#
# env VERBOSE=1 sh install.sh
#
# DO NOT EDIT THIS FILE
#
# This file is generated by rcm(7) as:
#
# rcup -fvg
#
# To update it, re-run the above command.
#
: ${VERBOSE:=0}
: ${CP:=/bin/cp}
: ${LN:=/bin/ln}
: ${MKDIR:=/bin/mkdir}
: ${RM:=/bin/rm}
: ${DIRNAME:=/usr/bin/dirname}
verbose() {
if [ "$VERBOSE" -gt 0 ]; then
echo "$@"
fi
}
handle_file_cp() {
if [ -e "$2" ]; then
printf "%s " "overwrite $2? [yN]"
read overwrite
case "$overwrite" in
y)
$RM -rf "$2"
;;
*)
echo "skipping $2"
return
;;
esac
fi
verbose "'$1' -> '$2'"
$MKDIR -p "$($DIRNAME "$2")"
$CP -R "$1" "$2"
}
handle_file_ln() {
if [ -e "$2" ]; then
printf "%s " "overwrite $2? [yN]"
read overwrite
case "$overwrite" in
y)
$RM -rf "$2"
;;
*)
echo "skipping $2"
return
;;
esac
fi
verbose "'$1' -> '$2'"
$MKDIR -p "$($DIRNAME "$2")"
$LN -sf "$1" "$2"
}
handle_file_cp "${PWD}/tag-zsh/config/zsh/git-prompt.zsh" "${HOME}/.config/zsh/git-prompt.zsh"
handle_file_ln "${PWD}/tag-zsh/zshenv" "${HOME}/.zshenv"
handle_file_ln "${PWD}/tag-zsh/zshrc" "${HOME}/.zshrc"
handle_file_ln "${PWD}/tag-vim/vim" "${HOME}/.vim"
handle_file_ln "${PWD}/tag-vim/vimrc" "${HOME}/.vimrc"
handle_file_ln "${PWD}/tag-tmux/tmux.conf" "${HOME}/.tmux.conf"
handle_file_ln "${PWD}/bashrc" "${HOME}/.bashrc"
handle_file_ln "${PWD}/config/alacritty" "${HOME}/.config/alacritty"
handle_file_ln "${PWD}/config/git" "${HOME}/.config/git"
handle_file_ln "${PWD}/config/kitty" "${HOME}/.config/kitty"
handle_file_ln "${PWD}/config/shells" "${HOME}/.config/shells"
handle_file_cp "${PWD}/config/systemd/user/ssh-agent.service" "${HOME}/.config/systemd/user/ssh-agent.service"
handle_file_ln "${PWD}/config/terminator" "${HOME}/.config/terminator"
handle_file_ln "${PWD}/config/user-dirs.conf" "${HOME}/.config/user-dirs.conf"
handle_file_ln "${PWD}/config/user-dirs.dirs" "${HOME}/.config/user-dirs.dirs"
handle_file_ln "${PWD}/ctags.d" "${HOME}/.ctags.d"
handle_file_ln "${PWD}/pam_environment" "${HOME}/.pam_environment"
handle_file_ln "${PWD}/rcrc" "${HOME}/.rcrc"
handle_file_ln "${PWD}/standalone_rcup.sh" "${HOME}/.standalone_rcup.sh"
handle_file_ln "${PWD}/toprc" "${HOME}/.toprc"
handle_file_ln "${PWD}/xinitrc" "${HOME}/.xinitrc"