-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
24 lines (19 loc) · 662 Bytes
/
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
#!/usr/bin/env bash
git clone --bare git@github.com:christoff-linde/dotfiles-macos.git
$HOME/.dotfiles
# define config alias locally
function config {
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
# create a directory to backup existing dotfiles
mkdir -p .dotfiles.backup
config checkout
if [ $? = 0 ]; then
echo "Checked out .dotfiles from git@github.com:christoff-linde/dotfiles-macos.git"
else
echo "Moving existing .dotfiles backup to .dotfiles.backup"
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs - I{} mv {} .dotfiles.backup/{}
fi
# checkout dotfiles from repo
config checkout
config config status.showUntrackedFiles no