-
Notifications
You must be signed in to change notification settings - Fork 4
/
macos10.15_configure_dev_env.sh
169 lines (152 loc) · 2.96 KB
/
macos10.15_configure_dev_env.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
#!/bin/bash
# Install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
if [ ! $? = 0 ]; then
exit 1
fi
brew -v
if [ ! $? = 0 ]; then
exit 1
fi
# Install
brew install git
if [ ! $? = 0 ]; then
exit 1
fi
# Reload $PATH
export PATH="/usr/local/bin:$PATH"
if [ ! $? = 0 ]; then
exit 1
fi
git --version
if [ ! $? = 0 ]; then
exit 1
fi
# Download executable in local user folder
curl -sS https://get.symfony.com/cli/installer | bash
if [ ! $? = 0 ]; then
exit 1
fi
# Move the executable in global bin directory in order to use it globally
sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony
if [ ! $? = 0 ]; then
exit 1
fi
symfony -V
if [ ! $? = 0 ]; then
exit 1
fi
# Install
brew install [email protected]
if [ ! $? = 0 ]; then
exit 1
fi
# Replace default macOS PHP installation in $PATH
brew link [email protected] --force
if [ ! $? = 0 ]; then
exit 1
fi
# Reload $PATH
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
if [ ! $? = 0 ]; then
exit 1
fi
# Install extensions
pecl install xdebug
if [ ! $? = 0 ]; then
exit 1
fi
# Update some configuration in php.ini
phpinipath=$(php -r "echo php_ini_loaded_file();")
if [ ! $? = 0 ]; then
exit 1
fi
sudo sed -i '' -e 's/post_max_size = 8M/post_max_size = 64M/g' ${phpinipath} > ./php.ini.tmp
if [ ! $? = 0 ]; then
exit 1
fi
sudo mv ./php.ini.tmp ${phpinipath}
if [ ! $? = 0 ]; then
exit 1
fi
sudo sed -i '' -e 's/upload_max_filesize = 8M/upload_max_filesize = 64M/g' ${phpinipath} > ./php.ini.tmp
if [ ! $? = 0 ]; then
exit 1
fi
sudo mv ./php.ini.tmp ${phpinipath}
if [ ! $? = 0 ]; then
exit 1
fi
sudo sed -i '' -e 's/memory_limit = 128M/memory_limit = -1/g' ${phpinipath} > ./php.ini.tmp
if [ ! $? = 0 ]; then
exit 1
fi
sudo mv ./php.ini.tmp ${phpinipath}
if [ ! $? = 0 ]; then
exit 1
fi
php -v
if [ ! $? = 0 ]; then
exit 1
fi
# Download installer
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
if [ ! $? = 0 ]; then
exit 1
fi
# Install
sudo php composer-setup.php --version=1.9.1 --install-dir=/usr/local/bin/
if [ ! $? = 0 ]; then
exit 1
fi
# Remove installer
sudo php -r "unlink('composer-setup.php');"
if [ ! $? = 0 ]; then
exit 1
fi
# Make it executable globally
sudo mv /usr/local/bin/composer.phar /usr/local/bin/composer
if [ ! $? = 0 ]; then
exit 1
fi
composer -V
if [ ! $? = 0 ]; then
exit 1
fi
# Install
brew install [email protected]
if [ ! $? = 0 ]; then
exit 1
fi
# Install
brew install node@12
if [ ! $? = 0 ]; then
exit 1
fi
# Add node to $PATH
brew link node@12 --force
if [ ! $? = 0 ]; then
exit 1
fi
node -v
if [ ! $? = 0 ]; then
exit 1
fi
npm -v
if [ ! $? = 0 ]; then
exit 1
fi
# Install
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.21.1
if [ ! $? = 0 ]; then
exit 1
fi
# Reload $PATH
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
if [ ! $? = 0 ]; then
exit 1
fi
yarn -v
if [ ! $? = 0 ]; then
exit 1
fi