-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault-apps.sh
More file actions
216 lines (198 loc) · 6.85 KB
/
default-apps.sh
File metadata and controls
216 lines (198 loc) · 6.85 KB
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
#!/bin/env bash
BASH_PROFILE="../../shells/.bash_profile"
ZSHENV="../../shells/.zshenv"
ZSHRC="../../shells/.zshrc"
echo "Do you prefer bash or zsh? (Please answer bash or zsh to run or press enter to skip.)"
select shell_choice in bash zsh; do
case $shell_choice in
"bash")
echo "Bash selected!"
chsh -s /bin/bash
if ! [ -f $HOME/.bash_profile ]; then
echo "Copying over bash_profile template!"
cp $BASH_PROFILE $HOME
source $HOME/.bash_profile
else
echo "Sourcing bash_profile!"
source $HOME/.bash_profile
fi
break
;;
"zsh")
echo "Zsh selected!"
chsh -s /bin/zsh
if ! [[ -f $HOME/.zshenv && -f $HOME/.zshrc ]]; then
cp $ZSHENV $HOME
cp $ZSHRC $HOME
fi
break
;;
*)
echo "Moving on then."
break
;;
esac
done
# Check if xcode-select is installed
if xcode-select --version >/dev/null 2>&1; then
echo "xcode-select is already installed."
else
echo "Installing xcode-select!"
# Install Xcode Command Line Tools
xcode-select --install
fi
# Check if Chrome is installed
if mdfind "kMDItemContentType == com.apple.application-bundle && kMDItemDisplayName == 'Google Chrome.app'" | grep -q "Google Chrome.app"; then
echo "Google Chrome is already installed."
else
echo "Installing Google Chrome!"
# Download & install Google Chrome
curl -o googlechrome.dmg https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
hdiutil mount googlechrome.dmg
sudo /Volumes/Google\ Chrome/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --install
sudo mv "/Volumes/Google Chrome/Google Chrome.app" "/Applications/"
open -a "Google Chrome"
hdiutil unmount /Volumes/Google\ Chrome
rm googlechrome.dmg
fi
# Check if Slack is installed
if [ -d "/Applications/Slack.app" ]; then
echo "Slack is already installed."
else
echo "Installing Slack!"
# Install Slack
curl -o slack.dmg https://downloads.slack-edge.com/releases/macos/Slack-latest.dmg
hdiutil mount slack.dmg
cp -R "/Volumes/Slack.app" /Applications/
hdiutil unmount "/Volumes/Slack.app"
rm slack.dmg
fi
echo "Which editor do you want to use?"
select editor in "VS Code" "Zed"; do
case $editor in
"VS Code")
# Check if VS Code is installed
if [ -d "/Applications/Visual Studio Code.app" ]; then
echo "VS Code is already installed."
else
echo "Installing VS Code!"
# Install Visual Studio Code
curl -L -o vscode.zip "https://code.visualstudio.com/sha/download?build=stable&os=darwin-universal"
unzip vscode.zip
rm vscode.zip
mv "Visual Studio Code.app" /Applications/
fi
break
;;
"Zed")
# Check if Zed is installed
if [ -d "/Applications/Zed.app" ]; then
echo "Zed is already installed."
else
echo "Installing Zed!"
# Install Zed
curl -L -o zed.zip "https://zed.dev/download/mac"
unzip zed.zip
rm zed.zip
mv "Zed.app" /Applications/
fi
break
;;
*)
echo "Invalid choice"
;;
esac
done
# Check if Postman is installed
if [ -d "/Applications/Postman.app" ]; then
echo "Postman is already installed."
else
echo "Installing Postman!"
# Install Postman
curl -o postman.zip https://dl.pstmn.io/download/latest/osx
unzip postman.zip
rm postman.zip
mv Postman.app /Applications/
fi
# Check if Brave Browser is installed
if [ -d "/Applications/Brave Browser.app" ]; then
echo "Brave Browser is already installed."
else
echo "Installing Brave Browser!"
# Install Brave Browser
curl -L -o brave.dmg "https://laptop-updates.brave.com/latest/osx"
hdiutil mount brave.dmg
cp -R "/Volumes/Brave Browser/Brave Browser.app" /Applications/
open -a "Brave Browser" --args --make-default-browser
hdiutil unmount "/Volumes/Brave Browser"
rm brave.dmg
fi
# Check if Firefox is installed
if mdfind "kMDItemContentType == com.apple.application-bundle && kMDItemDisplayName == 'Firefox.app'" | grep -q "Firefox.app"; then
echo "Firefox is already installed."
else
echo "Installing Firefox!"
# Download & install Firefox
curl -o firefox.dmg "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US"
hdiutil mount firefox.dmg
sudo cp -r "/Volumes/Firefox/Firefox.app" "/Applications/"
hdiutil unmount "/Volumes/Firefox"
rm firefox.dmg
fi
# Check if MongoDB Compass is installed
if [ -d "/Applications/MongoDB Compass.app" ]; then
echo "MongoDB Compass is already installed."
else
echo "Installing MongoDB Compass!"
# Install MongoDB Compass
curl -L -o mongodb-compass.dmg "https://downloads.mongodb.com/compass/mongodb-compass-1.28.1-macos-x64.dmg"
hdiutil mount mongodb-compass.dmg
cp -R "/Volumes/MongoDB Compass/MongoDB Compass.app" /Applications/
hdiutil unmount "/Volumes/MongoDB Compass"
rm mongodb-compass.dmg
fi
# Check if VLC Player is installed
if [ -d "/Applications/VLC.app" ]; then
echo "VLC Player is already installed."
else
echo "Installing VLC Player!"
# Install VLC Player
curl -L -o vlc.dmg "https://get.videolan.org/vlc/3.0.16/macosx/vlc-3.0.16.dmg"
hdiutil mount vlc.dmg
cp -R "/Volumes/vlc-3.0.16/VLC.app" /Applications/
hdiutil unmount "/Volumes/vlc-3.0.16"
rm vlc.dmg
fi
# Check if Discord is installed
if [ -d "/Applications/Discord.app" ]; then
echo "Discord is already installed."
else
echo "Installing Discord!"
# Install Discord
curl -L -o discord.dmg "https://discord.com/api/download?platform=osx"
hdiutil mount discord.dmg
cp -R "/Volumes/Discord/Discord.app" /Applications/
hdiutil unmount "/Volumes/Discord"
rm discord.dmg
fi
# Check if Zoom is installed
if [ -d "/Applications/zoom.us.app" ]; then
echo "Zoom is already installed."
else
echo "Installing Zoom!"
curl -L -o /tmp/zoomusInstaller.pkg "https://zoom.us/client/latest/ZoomInstallerIT.pkg"
sudo installer -pkg /tmp/zoomusInstaller.pkg -target /
rm /tmp/zoomusInstaller.pkg
fi
if [[ $(command -v rancher-desktop) ]]; then
echo "Rancher Desktop is already installed"
else
# Download the Rancher Desktop .dmg file
curl -LO https://github.com/rancher-sandbox/rancher-desktop/releases/download/v0.11.1/rancher-desktop-darwin-amd64.tar.gz
# Extract the contents of the .dmg file
hdiutil attach rancher-desktop-darwin-amd64.tar.gz
# Copy the Rancher Desktop.app file to the /Applications directory
cp -R /Volumes/Rancher\ Desktop/Rancher\ Desktop.app /Applications/
# Eject the mounted .dmg file
hdiutil detach /Volumes/Rancher\ Desktop/
fi