-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
86 lines (67 loc) · 3.07 KB
/
install.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
#!/bin/sh
set -eux
if [ $UID -eq 0 ]; then
echo ""
echo "------------------------------------"
echo "This script must NOT be run as ROOT"
echo "------------------------------------"
echo ""
exit 1
fi
export HOMEBREW_PREFIX=${HOMEBREW_PREFIX:-"/home/linuxbrew/.linuxbrew"}
# Install Requirements
curl -s https://raw.githubusercontent.com/digitalspacestdio/docker-homebrew/main/install-requirements.sh | sudo sh
# Install Ruby
curl -s https://raw.githubusercontent.com/digitalspacestdio/docker-homebrew/main/install-ruby.sh | sudo sh
# Install Homebrew
curl -s https://raw.githubusercontent.com/digitalspacestdio/docker-homebrew/main/install-homebrew.sh | sudo sh
sudo chown -R $(id -u):$(id -g) ${HOMEBREW_PREFIX}
BREW_BIN=${HOMEBREW_PREFIX}/bin/brew
[ -f "${BREW_BIN}" ] && {
if [ -f "$HOME/.zprofile" ]; then
grep 'eval "$('${BREW_BIN}' shellenv)"' "$HOME/.zprofile" || {
echo 'eval "$('${BREW_BIN}' shellenv)"' | tee -a $HOME/.zprofile
}
if echo $(uname -m)-$(uname -s | tr '[:upper:]' '[:lower:]') | grep aarch64; then
mkdir -p ${HOMEBREW_PREFIX}'/.tmp'
grep 'export HOMEBREW_TEMP='${HOMEBREW_PREFIX}'/.tmp' "$HOME/.zprofile" || {
echo 'export HOMEBREW_TEMP='${HOMEBREW_PREFIX}'/.tmp' | tee -a $HOME/.zprofile
}
fi
grep 'export HOMEBREW_NO_INSTALL_FROM_API=1' "$HOME/.zprofile" || {
echo 'export HOMEBREW_NO_INSTALL_FROM_API=1' | tee -a $HOME/.zprofile
}
grep 'export HOMEBREW_NO_ENV_HINTS=1' "$HOME/.zprofile" || {
echo 'export HOMEBREW_NO_ENV_HINTS=1' | tee -a $HOME/.zprofile
}
grep 'export HOMEBREW_NO_AUTO_UPDATE=1' "$HOME/.zprofile" || {
echo 'export HOMEBREW_NO_AUTO_UPDATE=1' | tee -a $HOME/.zprofile
}
grep 'export HOMEBREW_DEVELOPER=1' "$HOME/.zprofile" || {
echo 'export HOMEBREW_DEVELOPER=1' | tee -a $HOME/.zprofile
}
fi
if [ -f "$HOME/.bashrc" ]; then
grep 'eval "$('${BREW_BIN}' shellenv)"' "$HOME/.bashrc" || {
echo 'eval "$('${BREW_BIN}' shellenv)"' | tee -a $HOME/.bashrc
}
if echo $(uname -m)-$(uname -s | tr '[:upper:]' '[:lower:]') | grep aarch64; then
mkdir -p ${HOMEBREW_PREFIX}'/.tmp'
grep 'export HOMEBREW_TEMP='${HOMEBREW_PREFIX}'/.tmp' "$HOME/.bashrc" || {
echo 'export HOMEBREW_TEMP='${HOMEBREW_PREFIX}'/.tmp' | tee -a $HOME/.bashrc
}
fi
grep 'export HOMEBREW_NO_INSTALL_FROM_API=1' "$HOME/.bashrc" || {
echo 'export HOMEBREW_NO_INSTALL_FROM_API=1' | tee -a $HOME/.bashrc
}
grep 'export HOMEBREW_NO_ENV_HINTS=1' "$HOME/.bashrc" || {
echo 'export HOMEBREW_NO_ENV_HINTS=1' | tee -a $HOME/.bashrc
}
grep 'export HOMEBREW_NO_AUTO_UPDATE=1' "$HOME/.bashrc" || {
echo 'export HOMEBREW_NO_AUTO_UPDATE=1' | tee -a $HOME/.bashrc
}
grep 'export HOMEBREW_DEVELOPER=1' "$HOME/.bashrc" || {
echo 'export HOMEBREW_DEVELOPER=1' | tee -a $HOME/.bashrc
}
fi
}