-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·50 lines (39 loc) · 963 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
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
#!/bin/bash
git submodule update --init --recursive
# Script stolen from https://github.com/rasendubi/dotfiles/blob/master/setup.sh.
# This script installs all configs to home directory.
# You MUST write your configs yourself, never copy other's.
FILES=".vimrc .vim .oh-my-zsh .zshrc .tmux.conf .fzf"
DEST=$1
if [ -z "$DEST" ]; then
DEST="$HOME"
fi
BASE=$(dirname $(readlink -f $0))
ask_install() {
FILENAME=$1
LINK="$DEST/$FILENAME"
TARGET="$BASE/$FILENAME"
if [ -e $LINK ]; then
echo "$LINK exists. Skipping..."
else
read -r -p "Link $LINK to $TARGET? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
ln -s "$TARGET" "$LINK"
;;
esac
fi
}
# Link dotfiles to this dir.
for FILE in $FILES; do
ask_install $FILE
done
# Install fzf if desired.
if [ -e $HOME/.fzf ]; then
read -r -p "Install fzf? (No super user rights required) [y/N] " response
case $response in
[yY][eE][sS]|[yY])
$HOME/.fzf/install
;;
esac
fi