-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·50 lines (44 loc) · 1.04 KB
/
bootstrap
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/sh
case $1 in
mac)
;;
linux)
;;
server)
;;
*)
echo "Invalid configuration."
echo "Valid options:"
echo "- $0 mac (sets up a Mac workstation)"
echo "- $0 linux (sets up a Linux workstation)"
echo "- $0 server (sets up a *nix server)"
exit 1
esac
# First install brew on a mac
if [ `uname` = "Darwin" ]; then
which brew &>/dev/null || \
/usr/bin/ruby -e \
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install git and stow
brew install git stow
elif [ -f "/etc/arch-release" ]; then
sudo pacman -S --noconfirm git stow
elif [ `uname` = "FreeBSD" ]; then
sudo pkg install git stow
fi
# Now that git is available let's check out or update our dotfiles
if [ -d ~/.dotfiles ]; then
PREV=`pwd`
cd ~/.dotfiles
git pull
cd $PREV
else
git clone [email protected]:iantruslove/dotfiles.git ~/.dotfiles
fi
# Stow install our apps
~/.dotfiles/install $1
# Run the update
if [ "$1" = "mac" ]; then
# TODO: Uncomment ### ~/bin/update
echo "TODO"
fi