-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·79 lines (66 loc) · 1.96 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
#setup homebrew, dotfiles on a new machine
#not currently tested beyond the stow portion of things,
#need to set up an empty vagrant image for testing first
set -x
pushd $(dirname $0) > /dev/null
#### OS X or Linux? ####
UNAME=$(uname -s)
OS="unknown"
echo "proceeding with hassling stowaways for $UNAME"
if [ "Linux" = "$UNAME" ]; then
# Assumes linux is always an apt based system
#### install git and stow for linux ####
sudo apt-get install stow git -y;
OS="linux"
elif [ "Darwin" = "$UNAME" ]; then
brew=$(which brew)
if [[ -z "$brew" ]]; then
curl -fsSL "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh" > "/tmp/install_brew.sh"
bash /tmp/install_brew.sh
fi
OS="osx"
mkdir -p ~/Desktop/screenshots
defaults write com.apple.screencapture location ~/Desktop/screenshots
else
"Don't know what to do with stowaways with a uname of $UNAME"
exit 1;
fi
#### generate new ssh keys ####
if [ ! -f "$HOME/.ssh/id_rsa" ]; then
ssh-keygen -b 4096
fi
#### get dotfiles repo ####
GITDIR="$HOME/git"
mkdir -p "$GITDIR"
pushd "$GITDIR" > /dev/null
DOTREPO="dotfiles"
if [ ! -d "$HOME/git/dotfiles" ]; then
read -p "about to clone dotfiles repo, go ahead and add your new ssh key to github first, press enter when done"
git clone "[email protected]:ianferguson/$DOTREPO.git"
fi
pushd "$DOTREPO" > /dev/null
git submodule init
git submodule update
#### install brew bundles ####
if [ "osx" = "$OS" ]; then
pushd brew > /dev/null
# ./starter
brew doctor || true
popd > /dev/null
else
pushd apt > /dev/null
./starter
popd >/dev/null
fi;
#### pick up default fish universal env settings
fish universal_fish_vars
#### Deploy Stow Stuff ####
# use the relative path within the repo, since we won't have placed the script in
# the ~/bin and on path yet (i.e. it will place itself there while running
./stow/bin/deploy_stow
#### run rbenv bootstrap install
./rbenv/bin/initruby
popd > /dev/null
popd > /dev/null
popd > /dev/null