-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
36 lines (27 loc) · 1009 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
#!/bin/bash
if ! hash git &> /dev/null; then
echo "Error: This script requires git! Please install git, then try running this script again." 1>&2;
exit 1
fi
echo "Installing Jure Glasovic's dotfiles"
echo "Press [ENTER] to proceed, or [CTRL+C] to cancel installation."
read
path="$HOME/.dotfiles"
git clone https://github.com/jglasovic/dotfiles.git "$path"
if [ $? -ne 0 ]; then
echo "Error: There was a problem cloning the dotfiles repository! Try running this script again." 1>&2;
exit 1
fi
read -p "Use SSH remote for the dotfiles repository? [y/n] " -e USE_SSH_REMOTE
if [[ $USE_SSH_REMOTE =~ ^[Yy]$ ]]; then
git -C "$path" remote set-url origin [email protected]:jglasovic/dotfiles.git
fi
"$path"/install.sh
install_exit_code=$?
echo "================================================================================"
if [ $install_exit_code -ne 0 ]; then
echo "An error occurred during dotfiles installation." 1>&2;
exit 1
else
echo "The dotfiles were successfully installed! Enjoy!"
fi