From 2c91314cc06eb154aeff022ccb5f6f6eb62416a2 Mon Sep 17 00:00:00 2001 From: Jobs Gate Date: Fri, 27 Dec 2024 20:21:55 +0800 Subject: [PATCH] Feature Update: Enable user defined HOMEBREW_PREFIX in Linux This still defaults to HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" when HOMEBREW_PREFIX is not set --- install.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f3a0804b..e9bcc987 100755 --- a/install.sh +++ b/install.sh @@ -170,8 +170,17 @@ then else UNAME_MACHINE="$(uname -m)" - # On Linux, this script installs to /home/linuxbrew/.linuxbrew only + # On Linux, this script installs to /home/linuxbrew/.linuxbrew only if HOMEBREW_PREFIX is not set. + HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" + + if [ -z "$HOMEBREW_PREFIX" ]; then + echo "HOMEBREW_PREFIX is not set. Installing to $HOMEBREW_PREFIX" + else + echo "HOMEBREW_PREFIX is set to: $HOMEBREW_PREFIX" + echo "Installing to $HOMEBREW_PREFIX" + fi + HOMEBREW_REPOSITORY="${HOMEBREW_PREFIX}/Homebrew" HOMEBREW_CACHE="${HOME}/.cache/Homebrew"