-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·45 lines (37 loc) · 1.11 KB
/
install.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
#!/usr/bin/env bash
cat <<EOF
Link .{path,bash_prompt,exports,aliases,functions,extra,gitconfig}, bin to ~
EOF
cp .gitconfig.includes.example .gitconfig.includes
cp .gitconfig.local.example .gitconfig.local
touch .exports.local
dotfiles=(
# .path
# .bash_prompt
.exports
.exports.local
.aliases
.functions
# .extra
.gitconfig
.gitconfig.includes
.gitconfig.local
# bin
# rails
.railsrc
rails_template.rb
)
echo "Link dotfiles to $HOME"
for dotfile in "${dotfiles[@]}"; do
if [ -r "$dotfile" ] && [ -f "$dotfile" ]; then
echo "Linking $PWD/$dotfile to $HOME/$dotfile"
if [ -e "$HOME/$dotfile" ]; then
echo "$HOME/$dotfile already exists. Backing up to $HOME/$dotfile.bak"
mv "$HOME/$dotfile" "$HOME/$dotfile.bak"
fi
ln -s "$PWD/$dotfile" "$HOME/$dotfile"
fi
done
# VSCode
# mv $HOME/Library/Application\ Support/Code/User/keybindings.json $HOME/Library/Application\ Support/Code/User/keybindings.json.bak
# ln -s $PWD/.vscode/keybindings.json $HOME/Library/Application\ Support/Code/User/keybindings.json