Skip to content

Commit 4dba25e

Browse files
Feature Update: Enable user defined HOMEBREW_PREFIX in Linux
1 parent a7705fd commit 4dba25e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

install.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,16 @@ then
170170
else
171171
UNAME_MACHINE="$(uname -m)"
172172

173-
# On Linux, this script installs to /home/linuxbrew/.linuxbrew only
174-
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
173+
# On Linux, this script installs to /home/linuxbrew/.linuxbrew only if HOMEBREW_PREFIX is not set.
174+
175+
if [ -z "$HOMEBREW_PREFIX" ]; then
176+
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
177+
echo "HOMEBREW_PREFIX is not set. Installing to $HOMEBREW_PREFIX"
178+
else
179+
echo "HOMEBREW_PREFIX is set to: $HOMEBREW_PREFIX"
180+
echo "Installing to $HOMEBREW_PREFIX"
181+
fi
182+
175183
HOMEBREW_REPOSITORY="${HOMEBREW_PREFIX}/Homebrew"
176184
HOMEBREW_CACHE="${HOME}/.cache/Homebrew"
177185

0 commit comments

Comments
 (0)