-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-all.sh
executable file
·129 lines (107 loc) · 2.71 KB
/
install-all.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
#!/bin/sh
# Install basic tools and apps on a fresh copy of Mac OS X
# Reference: https://gist.github.com/millermedeiros/6615994
echo "Installing software and tools for macOS"
echo "Checking if user $(whoami) has admin rights. Please authenticate."
if [ "$EUID" = 0 ]; then
echo "Great, user is already logged in as admin."
else
sudo -k
if sudo true; then
echo "Great, you can run scripts as administrator."
else
echo "Wrong password or no admin rights."
exit 1
fi
fi
if [[ $(xcode-select -p) = *CommandLineTools* ]]; then
echo "Xcode is already installed."
else
echo "Installing Xcode utilities"
xcode-select --install
fi
if [[ $(command -v brew) = *brew* ]]; then
if [[ -z "${CI}" ]]; then
echo "Updating Homebrew installation"
brew update
fi
else
echo "Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "Checking Homebrew installation"
brew doctor
# Use with caution! This should not be necessary on most systems
# if [[ $(brew --prefix) = *homebrew* ]]; then
# echo "Setting up Homebrew permissions for local user"
# sudo chown -R $(whoami) $(brew --prefix)/*
# else
# echo "Can't set Homebrew permissions, because no prefix was found"
# fi
# Continue on error
set +e
# Disable Homebrew updates temporarily to save time
HOMEBREW_NO_AUTO_UPDATE=1
echo "Installing missing tools with Homebrew"
tools=(
docker
htop
imagemagick
jq
nmap
nvm
parallel
postgresql
python
r
tree
watch
wget
xsv
zsh
android-platform-tools
google-cloud-sdk
cocoapods
)
brew install ${tools[@]} || true
echo "Installing apps with Homebrew casks"
# Set folder for app installs
# APP_DIR="/Users/$USER/Applications"
APP_DIR="/Applications"
apps=(
1password
citrix-workspace
firefox
google-chrome
google-cloud-sdk
imageoptim
insomnia
microsoft-teams
postico
rstudio
signal
visual-studio-code
vlc
microsoft-excel
microsoft-word
android-studio
microsoft-outlook
drawio
displaylink
)
# TODO: Skip if already installed!
brew install --cask --appdir=$APP_DIR ${apps[@]} || true
echo "Cleaning up Homebrew"
brew cleanup
echo "Installing Oh My ZSH!"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "Setting ZSH als default shell"
chsh -s /bin/zsh
echo "Setup nvm"
mkdir ~/.nvm
sed -i~ '\nexport NVM_DIR="$HOME/.nvm"\n. "/usr/local/opt/nvm/nvm.sh"' ~/.zshrc
echo "Setup Gcloud"
sed -i~ 'source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc"' ~/.zshrc
sed -i~ 'source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc"' ~/.zshrc
echo "Installing GCloud utils"
gcloud components install kubectl gke-gcloud-auth-plugin