-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·33 lines (28 loc) · 796 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·33 lines (28 loc) · 796 Bytes
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
#!/bin/bash
# relink target-file source-file
relink() {
if [[ -h "$1" ]]; then
echo "Relinking $1"
# Symbolic link? Then recreate.
rm "$1"
ln -sn "$2" "$1"
elif [[ ! -e "$1" ]]; then
echo "Linking $1 to $2"
ln -sn "$2" "$1"
else
echo "$1 exists as a real file, skipping."
fi
}
DIR=$( cd "$( dirname "$0" )" && pwd )
relink ~/.bash_profile $DIR/.bash_profile
relink ~/.bashrc $DIR/.bashrc
relink ~/.bash_aliases $DIR/.bash_aliases
relink ~/.gitconfig $DIR/.gitconfig
relink ~/.gitignore_global $DIR/.gitignore_global
relink ~/.screenrc $DIR/.screenrc
relink ~/.inputrc $DIR/.inputrc
relink ~/.tmux.conf $DIR/.tmux.conf
relink ~/.vimrc $DIR/.vimrc
relink ~/.zshrc $DIR/.zshrc
mkdir -p ~/.hammerspoon
relink ~/.hammerspoon/init.lua $DIR/hammerspoon/init.lua