-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall
216 lines (191 loc) · 8.31 KB
/
install
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
#!/usr/bin/env bash
set -e
(
(
STARTING_DIR=$PWD
cd $HOME
)
(
export WELCOME_OPTIONS=21
export WELCOME_FILE="welcome-$(echo "0$((1 + $RANDOM % $WELCOME_OPTIONS))" | tail -c 3).txt"
echo ''
echo "$(< "$HOME/Code/dotfiles/art/$WELCOME_FILE")"
echo ''
echo 'We should only need the sudo password once:'
sudo -v
)
if test ! $(which brew); then
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing homebrew...'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
echo 'Done installing homebrew.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
fi
if test ! -e $HOME/.vim/autoload/plug.vim; then
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing vim-plug...'
curl --create-dirs -fLo $HOME/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo 'Done installing vim-plug.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
fi
# @see: https://intelephense.com/faq.html
if test ! -e $HOME/intelephense/licence.txt; then
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Setting up Intelephense license...'
mkdir -p $HOME/intelephense
echo 'Enter your Intelephense license key:'
read -s INTELEPHENSE_LICENSE_KEY
echo $INTELEPHENSE_LICENSE_KEY > $HOME/intelephense/licence.txt
echo 'Done setting up Intelephense license.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
fi
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Linking dotfiles...'
/bin/bash $HOME/Code/dotfiles/link
echo 'Done linking dotfiles.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Setting macos defaults...'
/bin/bash $HOME/Code/dotfiles/defaults
echo 'Done setting macos defaults.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing, updating, and cleaning up brew dependencies...'
sudo chown -R $(whoami) $(brew --prefix)/*
brew bundle --global
brew bundle cleanup --force --global
brew services cleanup
sudo brew services cleanup
sudo brew services stop --all
brew cleanup -s
brew cu --all --yes
echo 'Done installing, updating, and cleaning up brew dependencies.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing and updating npm dependencies...'
# Prevent the installation of typewritten from echoing to .zshrc
sudo mkdir -p /usr/local/share/zsh
sudo mkdir -p /usr/local/share/zsh/site-functions
sudo chmod a+rwx /usr/local/share/zsh/site-functions
npm install -g \
npm@latest \
spaceship-prompt \
typewritten \
@vue/cli \
git-trim \
vls \
intelephense
npm update -g
echo 'Done installing and updating npm dependencies.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing and updating composer dependencies...'
# Prevents composer from invalidating our sudo session
export COMPOSER_ALLOW_SUPERUSER=1
composer global update --with-all-dependencies
export COMPOSER_ALLOW_SUPERUSER=0
# sudo valet install
# sudo valet trust
echo 'Done installing and updating composer dependencies.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing and updating pecl dependencies...'
pecl update-channels
# pecl upgrade will also install if it isn't yet installed, where as pecl
# install will fail if it is installed.
# pecl upgrade pcov
echo 'Done installing and updating pecl dependencies.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing and updating FZF...'
$(brew --prefix)/opt/fzf/install --key-bindings --completion --update-rc --no-bash --no-fish
echo 'Done installing and updating FZF.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing and updating fz...'
curl --create-dirs -fLo $HOME/.bin/fz.sh https://raw.githubusercontent.com/changyuheng/fz/master/fz.sh
echo 'Done installing and updating fz.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
# $HOME/.vim/plugged/phpactor/bin/phpactor cache:clear
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Setting up zsh completion...'
rm -f $HOME/.zcompdump
brew completions link
echo 'Done setting up zsh completion.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Clean dependency manager caches...'
composer clear-cache
npm cache clean --force
yarn cache clean --all
echo 'Done additional dependency manager caches.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Remove VIM plugins so that they are updated to the latest on next open...'
rm -rf $HOME/.config/coc/ $HOME/.vim/plugged/
echo 'Done VIM plugins so that they are updated to the latest on next open'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Misc configurations...'
# Suppress the compinit error caused from us preventing the double .zshrc echo for typewritten earlier
sudo chmod 755 /usr/local/share/zsh/site-functions
sudo chown -R root:staff /usr/local/share/zsh
echo 'Done misc configurations.'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
(
echo ''
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Manual Steps:'
echo ''
echo "$(< $HOME/Code/dotfiles/installed.md)"
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
)
# If you receive “zsh compinit: insecure directories” warnings when
# attempting to load these completions, you may need to run this:
# see: https://docs.brew.sh/Shell-Completion
# compaudit | xargs chmod g-w
(
echo ''
echo 'Done!'
cd $STARTING_DIR
)
)