-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·45 lines (37 loc) · 1.2 KB
/
install
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
#!/usr/bin/env bash
set -e
SCRIPT_DIR=$(dirname "$(realpath "$0")")
if [[ -f "$HOME/.bashrc" ]]; then
read -rp ".bashrc already exists. Will be overwritten. Continue [y/n]?" confirmation
if [[ ! $confirmation =~ "y" ]]; then
exit 1
fi
fi
if [[ -f "$HOME/.profile" ]]; then
read -rp ".profile already exists. Will be overwritten. Continue [y/n]?" confirmation
if [[ ! $confirmation =~ "y" ]]; then
exit 1
fi
fi
if [[ -f "$HOME/.tmux.conf" ]]; then
read -rp ".tmux.conf already exists. Will be overwritten. Continue [y/n]?" confirmation
if [[ ! $confirmation =~ "y" ]]; then
exit 1
fi
fi
if [[ -d "$HOME/.config/nvim" ]]; then
read -rp ".config/nvim already exists. Will be overwritten. Continue [y/n]?" confirmation
if [[ ! $confirmation =~ "y" ]]; then
exit 1
fi
fi
echo "Removing existing config files..."
rm -f "$HOME/.bashrc"
rm -f "$HOME/.profile"
rm -f "$HOME/.tmux.conf"
rm -rf "$HOME/.config/nvim"
echo "Linking config files to here ('$SCRIPT_DIR')..."
ln -s "$SCRIPT_DIR/bashrc" "$HOME/.bashrc"
ln -s "$SCRIPT_DIR/profile" "$HOME/.profile"
ln -s "$SCRIPT_DIR/tmux.conf" "$HOME/.tmux.conf"
ln -s "$SCRIPT_DIR/nvim" "$HOME/.config/nvim"