-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·44 lines (37 loc) · 1.11 KB
/
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
#!/usr/bin/env bash
set -u
abort() {
printf "%s\n" "$@"
exit 1
}
# First check if Bash is available.
if [ -z "${BASH_VERSION:-}" ]; then
abort "Bash is required to interpret this script."
fi
# Next, check the OS.
OS="$(uname)"
if [[ "$OS" != "Darwin" ]]; then
abort "macOS is the only supported platform at the moment."
fi
# Install Command Line Tools, if needed.
if ! [[ -e "/Library/Developer/CommandLineTools/usr/bin/git" ]]; then
echo "Install Command Line Tools..."
sudo /usr/bin/xcode-select --install
read -n 1 -s -r -p "Press any key once installation has completed."
sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
fi
if [ ! -d "$HOME/.dotfiles" ]; then
echo "Bootstrapping dotfiles for the first time..."
git clone https://github.com/dbburgess/dotfiles.git "$HOME/.dotfiles"
$HOME/.dotfiles/scripts/bootstrap.sh
else
echo "dotfiles already setup."
echo ""
echo "Do you want to run the bootstrap install again for good measure?"
select yn in "Yes" "No"; do
case $yn in
Yes ) $HOME/.dotfiles/scripts/bootstrap.sh; break;;
No ) exit;;
esac
done
fi