forked from pivotal/workstation-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·63 lines (55 loc) · 1.79 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
#!/usr/bin/env bash
#
# setup.sh: run the Pivotal workstation setup
#
# Arguments:
# - a list of components to install, see scripts/opt-in/ for valid options
#
# Environment variables:
# - SKIP_ANALYTICS: Set this to 1 to not send usage data to our Google Analytics account
#
# Fail immediately if any errors occur
set -e
echo "Caching password..."
sudo -K
sudo true;
clear
MY_DIR="$(dirname "$0")"
SKIP_ANALYTICS=${SKIP_ANALYTICS:-0}
if (( SKIP_ANALYTICS == 0 )); then
clientID=$(od -vAn -N4 -tx < /dev/urandom)
source ${MY_DIR}/scripts/helpers/google-analytics.sh ${clientID} start $@
else
export HOMEBREW_NO_ANALYTICS=1
fi
# Note: Homebrew needs to be set up first
source ${MY_DIR}/scripts/common/homebrew.sh
source ${MY_DIR}/scripts/common/configuration-bash.sh
# Place any applications that require the user to type in their password here
brew tap caskroom/cask
brew cask install github
brew cask install zoomus
source ${MY_DIR}/scripts/common/git.sh
source ${MY_DIR}/scripts/common/git-aliases.sh
source ${MY_DIR}/scripts/common/cloud-foundry.sh
source ${MY_DIR}/scripts/common/applications-common.sh
source ${MY_DIR}/scripts/common/applications-button.sh
source ${MY_DIR}/scripts/common/unix.sh
source ${MY_DIR}/scripts/common/configuration-osx.sh
source ${MY_DIR}/scripts/common/configurations.sh
# For each command line argument, try executing the corresponding script in opt-in/
for var in "$@"
do
echo "$var"
FILE=${MY_DIR}/scripts/opt-in/${var}.sh
echo "$FILE"
if [ -f $FILE ]; then
source ${FILE}
else
echo "Warning: $var does not appear to be a valid argument. File $FILE does not exist."
fi
done
source ${MY_DIR}/scripts/common/finished.sh
if (( SKIP_ANALYTICS == 0 )); then
source ${MY_DIR}/scripts/helpers/google-analytics.sh ${clientID} finish $@
fi