-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·147 lines (128 loc) · 3.73 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
#!/bin/bash
DOTFILESHOME="/Volumes/GoogleDrive/My Drive/dotfiles"
CYAN='\033[0;36m'
NC='\033[0m'
# log helper
log () {
printf "${CYAN}$1${NC}\n"
}
# homebrew
log "=> Installing Homebrew"
if ! command -v brew &> /dev/null
then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# brew packages
log "=> Installing brew packages"
brew install git
brew install gh
brew install exercism
brew install gcc
brew install cmake
brew install golang
brew install postgresql
brew install mailhog
brew install youtube-dl
brew install responsively
brew install ffmpeg
brew install raycast
brew install meetingbar
brew tap mongodb/brew && brew install [email protected]
brew install redis
brew install nginx
brew install rabbitmq && rabbitmq-plugins enable rabbitmq_management
brew install java && sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
# setup brew services
brew services start postgresql
brew services start mailhog
brew services start [email protected]
brew services start redis
brew services start nginx
brew services start rabbitmq
# rust
if ! command -v rustup &> /dev/null
then
log "=> Installing Rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
else
log "=> Updating Rust"
rustup update &> /dev/null
fi
# nodejs (temporarily disabled)
# if ! command -v n &> /dev/null
# then
# log "=> Installing Node.js"
# curl -L https://git.io/n-install | bash
# zsh ~/.zshrc
# else
# log "=> Node.js is already installed"
# fi
# vs code
if ! test -d "/Applications/Visual Studio Code.app"
then
log "=> Installing VS Code"
rm -rf vscode.zip
curl "https://code.visualstudio.com/sha/download?build=stable&os=darwin-universal" -L --output vscode.zip
unzip -q vscode.zip
mv "Visual Studio Code.app" /Applications/
rm -rf vscode.zip
else
log "=> VS Code is already installed"
fi
# add vs code to path
if ! test -f "/usr/local/bin/code"
then
log "=> Adding VS Code to path"
ln -s "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" "/usr/local/bin/code"
else
log "=> VS Code is already in the path"
fi
# install vs code extensions
log "=> Installing VS Code extensions"
code --install-extension "shan.code-settings-sync" --force
# export terminal helpers from google drive
if test -d "/Volumes/GoogleDrive"
then
cat ~/.zshrc | grep zsh_helpers > /dev/null
if ! cat ~/.zshrc | grep zsh_helpers > /dev/null
then
log "=> Exporting terminal helpers"
echo -e "\n# terminal helpers\nsource \"$DOTFILESHOME/zsh_helpers.sh\"\n" >> ~/.zshrc
zsh ~/.zshrc
else
log "=> Terminal helpers are already exported"
fi
else
log "=> Missing Google Drive folder, unable to export terminal helpers"
fi
# gpg tools
if ! test -d "/Applications/GPG Keychain.app/"
then
log "=> Installing GPG Tools"
GPG_TOOLS_LINK=`curl -s https://gpgtools.org/ | grep -Eo "https://releases.gpgtools.org/GPG_Suite.*\.dmg" | head -n 1`
curl $GPG_TOOLS_LINK --output gpgtools.dmg
open gpgtools.dmg
open "/Volumes/GPG Suite/Install.pkg" &
else
log "=> GPG Tools is already installed, run \`./gpg.sh\` to configure"
fi
# setup default git branch name
git config --global init.defaultBranch
# configure exercism
EXERCISM_TOKEN=`cat "$DOTFILESHOME/env/exercism"`
mkdir -p ~/Repos/fmoliveira/exercism
exercism configure --token=$EXERCISM_TOKEN --workspace "~/Repos/fmoliveira/exercism/"
# list versions
log "=> Everything set up!"
git --version
gh --version | head -n 1
exercism version
printf "GCC version "
gcc --version | head -n 1
cmake --version | head -n 1
rustc --version
go version
NODE_VERSION=`node --version`
printf "Node version ${NODE_VERSION}\n"
CODE_VERSION=`code --version | head -n 1`
printf "VS Code version ${CODE_VERSION}\n"