forked from pivotal/workstation-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·65 lines (56 loc) · 1.75 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
#!/usr/bin/env bash
#
# setup.sh: run the 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
# Install everything else
source ${MY_DIR}/scripts/common/editors.sh
source ${MY_DIR}/scripts/common/git.sh
source ${MY_DIR}/scripts/common/git-aliases.sh
source ${MY_DIR}/scripts/common/applications-common.sh
source ${MY_DIR}/scripts/common/developer-utilities.sh
source ${MY_DIR}/scripts/common/unix.sh
source ${MY_DIR}/scripts/common/configuration-osx.sh
source ${MY_DIR}/scripts/common/docker.sh
## Languages
source ${MY_DIR}/scripts/common/node.sh
source ${MY_DIR}/scripts/common/golang.sh
## Synap bits
source ${MY_DIR}/scripts/common/monorepo.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