-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bash
More file actions
executable file
·41 lines (36 loc) · 1.01 KB
/
Copy pathinstall.bash
File metadata and controls
executable file
·41 lines (36 loc) · 1.01 KB
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
#!/bin/bash
unset CDPATH
cd "$(dirname $0)"
if [ "${1}" = '-f' ]; then
FORCE=1
fi
declare -A CONFIGS=(
[alacritty.toml]='.config/alacritty/alacritty.toml'
[aliases.bash]='.aliases.bash'
[bashrc]='.bashrc'
[chad.fish]='.config/fish/functions/chad.fish'
[config.fish]='.config/fish/config.fish'
[ctags]='.ctags'
[e.fish]='.config/fish/functions/e.fish'
[ec.fish]='.config/fish/functions/ec.fish'
[gdbinit]='.gdbinit'
[gitconfig]='.gitconfig'
[hgrc]='.hgrc'
[i3_config]='.config/i3/config'
[i3status_config]='.config/i3status/config'
[jj-update-all.fish]='.config/fish/functions/jj-update-all.fish'
[lesskey]='.lesskey'
[tmux.conf]='.tmux.conf'
[update-all.fish]='.config/fish/functions/update-all.fish'
[vimrc]='.vimrc'
)
LN_ARGS='-s'
if [ -n "${FORCE}" ]; then
LN_ARGS="${LN_ARGS}f"
fi
for FILE in "${!CONFIGS[@]}"; do
DEST="${CONFIGS[$FILE]}"
echo "Symlinking ${FILE} to ${DEST}"
mkdir -p $(dirname "${HOME}/${DEST}")
ln "${LN_ARGS}" "$(realpath ${FILE})" "${HOME}/${DEST}"
done