-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·86 lines (75 loc) · 1.86 KB
/
setup.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
dir="$(pwd)"
files=".bash_profile .tmux.conf .khdrc .chunkwmrc .hushlogin .inputrc .railsrc .vim .vimrc .functions .aliases .spacemacs .bashrc .zshrc .zsh .zprofile .eslintrc.json"
binaries="colortest.sh rdh.sh splash.sh"
cd $dir
for file in $files; do
echo "Linking $dir/$file to $file."
ln -sf $dir/$file ~/$file
done
# iterm install
printf "\n"
read -p "Install iTerm2 theme? [y/n]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
printf "\n"
echo "Copying iterm config"
printf "\n"
cp $dir/iterm/com.googlecode.iterm2.plist ${HOME}/Library/Application\ Support/iTerm
else
printf "\n"
fi
# Secret env variables
if [ -f .secrets ]; then
ln -sf $dir/".secrets" ~/".secrets"
fi
if [ -f .gitconfig ]; then
ln -sf $dir/".gitconfig" ~/".gitconfig"
fi
# brew install
printf "\n"
read -p "Install all brew packages? [y/n]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
printf "\n\n"
echo "Installing packages with brew"
echo "This may take a while"
printf "\n"
sh ./brew/install.sh
printf "\n"
echo "Done!"
else
printf "\n"
fi
# macos configure.sh
if [ "$(uname)" == "Darwin" ]; then
printf "\n"
read -p "Set macOS defaults from macos/configure.sh? [y/n]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
printf "\n"
echo "Setting defaults, some programs (Finder, Dock etc) may restart on completion"
printf "\n"
sh ./macos/configure.sh
else
printf "\n"
fi
fi
# bin install
printf "\n"
read -p "Install binaries to /usr/local/bin? [y/n]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
printf "\n"
echo "Installing binaries"
printf "\n"
for bin in $binaries; do
new_bin=${bin%.*}
echo "Linking $dir/bin/$bin to /usr/local/bin/$new_bin"
ln -sf $dir/bin/$bin /usr/local/bin/$new_bin
done
else
printf "\n"
fi
# vim plugins install
printf "\n"
echo "Installing vim plugins"
printf "\n"
sh ./vim/install.sh
source ~/.zshrc