forked from donnemartin/dev-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·48 lines (40 loc) · 1002 Bytes
/
bootstrap.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
#!/usr/bin/env bash
#git pull origin master;
function doIt() {
if [[ -d ~/dev/git/dotfiles ]]; then
pushd ~/dev/git/dotfiles
FILES="$(ls -a)"
echo $FILES
for f in $FILES; do
if [ -d $f ]; then
echo $f
echo "Directory, skipping"
else
ln -s ${HOME}/dev/git/dotfiles/$f ${HOME}/$f;
fi
done
popd
fi
}
function syncNeovimAndRG() {
if [[ ! -d ~/.config ]]; then
mkdir -p ~/.config
fi
if [[ -d ~/dev/git/dotfiles ]]; then
ln -s ${HOME}/dev/git/dotfiles/nvim ${HOME}/.config/nvim
ln -s ${HOME}/dev/git/dotfiles/ripgrep ${HOME}/.config/ripgrep
fi
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
doIt;
syncNeovimAndRG;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
syncNeovimAndRG;
fi;
fi;
unset doIt;
unset syncNeovim;