This repository has been archived by the owner on Jun 14, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·70 lines (64 loc) · 1.83 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /bin/sh
#
# install.sh
#
# This script installs all of my dotfiles to my home directory.
# Sym Links
DOTFILE_DIR=$HOME/dotfiles
INSTALL_DIR=$HOME
SYM_LINKS=$HOME/dotfiles/setup/sym-link-list
# Bin Directory
BIN_DIR=$HOME/bin
BIN_REPO="[email protected]:sumnerevans/scripts.git"
echo "install.sh"
echo
echo "Create Symbolic Links"
echo "============================================================"
echo "DOTFILE_DIR=$DOTFILE_DIR"
echo "INSTALL_DIR=$INSTALL_DIR"
echo "SYM_LINKS=$SYM_LINKS"
echo
echo "BIN_DIR=$BIN_DIR"
echo "BIN_REPO=$BIN_REPO"
echo "============================================================"
echo
read -p "Proceed with installation? (Y/n)" choice
case "$choice" in
""|y|Y|yes|Yes|YES ) ;; # Proceed with install
*) echo "Aborting installation."; exit ;;
esac
echo "Creating symbolic links..."
while read LINK
do
echo "Linking $LINK"
if [[ -d "$INSTALL_DIR/$LINK" || -f "$INSTALL_DIR/$LINK" ]]; then
echo " $LINK already exists"
read -p " Would you like to override? (y/N) " override </dev/tty
case "$override" in
y|Y|yes|Yes|YES ) echo " Overriding $LINK." ;;
*) continue
esac
fi
echo " $DOTFILE_DIR/$LINK -> $INSTALL_DIR/$LINK"
rm -rf "$INSTALL_DIR/$LINK"
ln -fs "$DOTFILE_DIR/$LINK" "$INSTALL_DIR/$LINK"
done < $SYM_LINKS
echo ""
echo "Clone Bin Directory"
if [[ ! $(command -v git) ]]; then
read -p "ERROR: git not installed. Please install it before proceeding."
fi
if [[ -d "$BIN_DIR" ]]; then
echo "bin already exists."
read -p " Would you like to override? (y/N) " override </dev/tty
case "$override" in
y|Y|yes|Yes|YES )
echo " Deleting $BIN_DIR."
rm -rf $BIN_DIR
git clone $BIN_REPO $BIN_DIR
;;
*) continue
esac
else
git clone $BIN_REPO $BIN_DIR
fi