-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply.sh
executable file
·50 lines (33 loc) · 1.07 KB
/
apply.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
#!/bin/bash
set -o errexit
set -o nounset
lawn="$(cd "$(dirname "$0")"; pwd)"
link() {
local lawn_path="$lawn/$1"
local home_path="$2"
if [[ $home_path != /* ]]; then
home_path="$HOME/$home_path"
fi
if [[ ! -e "$lawn_path" ]]; then
echo "Nothing present at $lawn_path, skipping."
return
fi
if [[ ! -e "$home_path" ]]; then
mkdir -p "$(dirname "$home_path")"
echo "$(tput setaf 2)$(tput bold)$(ln -vsf "$lawn_path" "$home_path")$(tput sgr 0)" | sed "s:$HOME:~:g"
elif [[ $(readlink "$home_path") == "$lawn_path" ]]; then
echo "$(tput setaf 4)No change for $lawn_path$(tput sgr 0)" | sed "s:$HOME:~:g"
else
echo "$(tput setaf 1)$(tput bold)Skipping '$lawn_path -> $home_path'$(tput sgr 0)" | sed "s:$HOME:~:g"
fi
}
link "shell/zsh" .zshrc
link "vim/vimfiles" .vim
link "tmux.conf" .tmux.conf
link "git/config" .gitconfig
link "alacritty.yml" .config/alacritty.yml
link "mongorc.js" .mongorc.js
link "mongoshrc.js" .mongoshrc.js
link "qutebrowser" .qutebrowser
link "xbar" Library/"Application Support"/xbar/plugins
link "Caddyfile" /usr/local/etc/Caddyfile