-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·76 lines (61 loc) · 1.78 KB
/
bootstrap
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
#!/usr/bin/env bash
# Define toolbox directory
TOOLBOX="$HOME/.exolnet/toolbox"
# Define machine architecture
UNAME_MACHINE=$(/usr/bin/uname -m)
echo "Installing homebrew ..."
echo
if [[ -z $(command -v brew) ]]; then
# Homebrew will install the Command Line Tools, no need to run `xcode-select --install` beforehand
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo
fi
if [[ "${UNAME_MACHINE}" == "arm64" ]]; then
echo "Installing rosetta 2 ..."
sudo softwareupdate --install-rosetta --agree-to-license
echo
fi
echo "Configuring environment variables ..."
echo
# This section logic and code was taken from https://github.com/Homebrew/install/blob/HEAD/install.sh
if [[ "${UNAME_MACHINE}" == "arm64" ]]; then
HOMEBREW_PREFIX="/opt/homebrew"
else
HOMEBREW_PREFIX="/usr/local"
fi
case "${SHELL}" in
*/bash*)
if [[ -r "${HOME}/.bash_profile" ]]; then
shell_profile="${HOME}/.bash_profile"
else
shell_profile="${HOME}/.profile"
fi
;;
*/zsh*)
shell_profile="${HOME}/.zprofile"
;;
*)
shell_profile="${HOME}/.profile"
;;
esac
shell_env=$(${HOMEBREW_PREFIX}/bin/brew shellenv)
# Add homebrew shell environment variables to shell profile
cat >> "${shell_profile}" <<EOL
# HOMEBREW BEGIN
${shell_env}
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
# HOMEBREW END
EOL
# Load homebrew shell environment variables for this session
echo "${shell_env}"
eval "${shell_env}"
echo
echo "Cloning exolnet-macos-toolbox ..."
echo
# Clone exolnet-macos-toolbox
git clone -b master https://github.com/eXolnet/exolnet-macos-toolbox.git "$TOOLBOX"
cd "$TOOLBOX"
echo
echo "Installing exolnet-macos-toolbox ..."
# Install exolnet-macos-toolbox
./install