-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·76 lines (64 loc) · 1.65 KB
/
setup.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
#!/bin/bash
DOTFILES_HOME="$HOME/.dotfiles"
VERBOSE=false
mkdir -p ~/bin
puts(){
if [ $VERBOSE = true ]; then
echo "$1"
fi
}
files=(
ctags
editrc
hammerspoon
irbrc
psqlrc
vim
vimrc
zshrc
)
for filename in ${files[*]}; do
CANDIDATE="$HOME/.$filename"
if [ ! -f "$CANDIDATE" ] && [ ! -d "$CANDIDATE" ]; then
ln -s "$DOTFILES_HOME/$filename" "$CANDIDATE"
else
puts "$CANDIDATE already exists, skipping"
fi
done
GITCONFIG=~/.gitconfig
if [ ! -f "$GITCONFIG" ]; then
cp "$DOTFILES_HOME/gitconfig.global" "$GITCONFIG"
else
puts "$GITCONFIG already exists, skipping"
fi
#create .config groups if they exist
if [ -d .config ]; then
cd .config || exit
for filename in *; do
CANDIDATE="$HOME/.config/$filename"
if [ ! -f "$CANDIDATE" ] && [ ! -d "$CANDIDATE" ]; then
ln -s "$DOTFILES_HOME/.config/$filename $CANDIDATE"
else
puts "$CANDIDATE already exists, skipping"
fi
done
fi
mkdir -p "${XDG_CONFIG_HOME:=$HOME/.config}"
if [ ! -d "$XDG_CONFIG_HOME/nvim" ]; then
ln -s "$DOTFILES_HOME/vim" "$XDG_CONFIG_HOME/nvim"
else
puts "$XDG_CONFIG_HOME/nvim already exists, skipping"
fi
if [ ! -f "$XDG_CONFIG_HOME/nvim/init.vim" ]; then
ln -s "$DOTFILES_HOME/vimrc" "$XDG_CONFIG_HOME/nvim/init.vim"
else
puts "$XDG_CONFIG_HOME/nvim/init.vim already exists, skipping"
fi
#make sure gpg exists for programs that use it
if command -v gpg2 >/dev/null 2>&1; then
ln -s "$(command -v gpg2)" ~/bin/gpg
fi
mkdir -p ~/.sbt/0.13/plugins
mkdir -p ~/.sbt/1.0/plugins
ln -s "$DOTFILES_HOME/sbtplugins.sbt" ~/.sbt/0.13/plugins/dotfileplugins.sbt
ln -s "$DOTFILES_HOME/sbtplugins.sbt" ~/.sbt/1.0/plugins/dotfileplugins.sbt