-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
133 lines (101 loc) · 2.66 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/env bash
function __finish__() {
source ~/.zshrc
echo "We're done. Your MAC is now setup!"
}
function __basic__() {
# Install basic apps
source brew.sh
# Install oh-my-zsh
source install.sh zsh
}
function __core__() {
# Vim
cp .vimrc ~/.vimrc
vim +PluginInstall +qall
sudo -v
# Zsh Autosuggestions
ZSH_AUTOSUGGESTIONS_DIR="$ZSH_CUSTOM/plugins/zsh-autosuggestions"
if [ ! -d "$ZSH_AUTOSUGGESTIONS_DIR" ]; then
sudo git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_AUTOSUGGESTIONS_DIR
fi
# Rafiki zsh theme
sudo mkdir -p $ZSH_CUSTOM/themes && sudo curl -o $ZSH_CUSTOM/themes/rafiki.zsh-theme https://raw.githubusercontent.com/NdagiStanley/rafiki-zsh/own-editions/rafiki.zsh-theme
# Copy functions, aliases, zshrc
cp .functions ~/.functions
cp .aliases ~/.aliases
sudo cp .zshrc ~/.zshrc
# Link zsh, functions, aliases, git, vim
__link__
}
function __link__() {
sh link.sh --main
}
function __work__() {
echo "Running Work setup..."
# Vim
# Copy functions, aliases, zshrc
# Zsh Autosuggestions
# Rafiki zsh theme
__core__
# Brew install only a few work-critical apps
source install.sh workbrew
# Python
__python__
# JS
__javascript__
# Link zsh, functions, aliases, git, vim
__link__
__finish__
}
function __python__() {
echo "Running Python setup..."
source install.sh pip
source code/virtualenvwrapper.sh
# functions, aliases, zshrc
cp .functions ~/.functions
cp .aliases ~/.aliases
cp .zshrc ~/.zshrc
}
function __javascript__() {
source install.sh npm
# npm install
npm i -g npm@latest
npm i -g ijavascript
npm i -g httpster
}
function __pro__() {
echo "Running Pro setup..."
# Vim
# Copy functions, aliases, zshrc
# Zsh Autosuggestions
# Rafiki zsh theme
__core__
# Brew install everything
source install.sh probrew
# Python
__python__
# JS
__javascript__
# Postgres
brew services start postgresql
createdb `whoami`
# CircleCI CLI
curl -o /usr/local/bin/circleci https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci && chmod +x /usr/local/bin/circleci
# tmux
cp .tmux.conf ~/.tmux.conf
# Link tmux
sh link.sh tmux
__finish__
}
function __windows__() {
echo "Running Windows setup..."
source install.sh choco
cd windows_os && source setup.sh
cd ..
}
if [ "$1" != "" ] && type "__$1__" &> /dev/null; then
eval "__$1__"
else
echo "Usage: ./setup.sh (basic/ finish/ core/ python/ javascript/ work/ pro/ windows)"
fi