cmd/shellenv.sh: support multi-instance installation
This commit is contained in:
parent
9e11fcf31e
commit
7cc37fb7f8
@ -15,31 +15,31 @@ homebrew-shellenv() {
|
||||
echo "set -gx HOMEBREW_PREFIX \"${HOMEBREW_PREFIX}\";"
|
||||
echo "set -gx HOMEBREW_CELLAR \"${HOMEBREW_CELLAR}\";"
|
||||
echo "set -gx HOMEBREW_REPOSITORY \"${HOMEBREW_REPOSITORY}\";"
|
||||
[[ -n "${HOMEBREW_SHELLENV_SET}" ]] && return
|
||||
[[ ":${HOMEBREW_SHELLENV_SET}:" == *":${HOMEBREW_PREFIX}:"* ]] && return
|
||||
echo "set -q PATH; or set PATH ''; set -gx PATH \"${HOMEBREW_PREFIX}/bin\" \"${HOMEBREW_PREFIX}/sbin\" \$PATH;"
|
||||
echo "set -q MANPATH; or set MANPATH ''; set -gx MANPATH \"${HOMEBREW_PREFIX}/share/man\" \$MANPATH;"
|
||||
echo "set -q INFOPATH; or set INFOPATH ''; set -gx INFOPATH \"${HOMEBREW_PREFIX}/share/info\" \$INFOPATH;"
|
||||
echo "set -gx HOMEBREW_SHELLENV_SET 1;"
|
||||
echo "set -q HOMEBREW_SHELLENV_SET; or set HOMEBREW_SHELLENV_SET ''; set -gx HOMEBREW_SHELLENV_SET \"${HOMEBREW_PREFIX}\" \$HOMEBREW_SHELLENV_SET;"
|
||||
;;
|
||||
csh | -csh | tcsh | -tcsh)
|
||||
echo "setenv HOMEBREW_PREFIX ${HOMEBREW_PREFIX};"
|
||||
echo "setenv HOMEBREW_CELLAR ${HOMEBREW_CELLAR};"
|
||||
echo "setenv HOMEBREW_REPOSITORY ${HOMEBREW_REPOSITORY};"
|
||||
[[ -n "${HOMEBREW_SHELLENV_SET}" ]] && return
|
||||
[[ ":${HOMEBREW_SHELLENV_SET}:" == *":${HOMEBREW_PREFIX}:"* ]] && return
|
||||
echo "setenv PATH ${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:\$PATH;"
|
||||
echo "setenv MANPATH ${HOMEBREW_PREFIX}/share/man\`[ \${?MANPATH} == 1 ] && echo \":\${MANPATH}\"\`:;"
|
||||
echo "setenv INFOPATH ${HOMEBREW_PREFIX}/share/info\`[ \${?INFOPATH} == 1 ] && echo \":\${INFOPATH}\"\`;"
|
||||
echo "setenv HOMEBREW_SHELLENV_SET 1;"
|
||||
echo "setenv HOMEBREW_SHELLENV_SET ${HOMEBREW_PREFIX}\`[ \${?HOMEBREW_SHELLENV_SET} == 1 ] && echo \":\${HOMEBREW_SHELLENV_SET}\"\`;"
|
||||
;;
|
||||
*)
|
||||
echo "export HOMEBREW_PREFIX=\"${HOMEBREW_PREFIX}\";"
|
||||
echo "export HOMEBREW_CELLAR=\"${HOMEBREW_CELLAR}\";"
|
||||
echo "export HOMEBREW_REPOSITORY=\"${HOMEBREW_REPOSITORY}\";"
|
||||
[[ -n "${HOMEBREW_SHELLENV_SET}" ]] && return
|
||||
[[ ":${HOMEBREW_SHELLENV_SET}:" == *":${HOMEBREW_PREFIX}:"* ]] && return
|
||||
echo "export PATH=\"${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin\${PATH+:\$PATH}\";"
|
||||
echo "export MANPATH=\"${HOMEBREW_PREFIX}/share/man\${MANPATH+:\$MANPATH}:\";"
|
||||
echo "export INFOPATH=\"${HOMEBREW_PREFIX}/share/info:\${INFOPATH:-}\";"
|
||||
echo "export HOMEBREW_SHELLENV_SET=1;"
|
||||
echo "export HOMEBREW_SHELLENV_SET=\"${HOMEBREW_PREFIX}\${HOMEBREW_SHELLENV_SET+:\$HOMEBREW_SHELLENV_SET}\";"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@ -306,8 +306,8 @@ module Homebrew
|
||||
boolean: true,
|
||||
},
|
||||
HOMEBREW_SHELLENV_SET: {
|
||||
description: "If set, `brew shellenv` skips export statements for paths.",
|
||||
boolean: true,
|
||||
description: "A colon separated list of brew prefixes. If it is set and contains the current brew prefix, " \
|
||||
"`brew shellenv` skips export statements for paths.",
|
||||
},
|
||||
all_proxy: {
|
||||
description: "Use this SOCKS5 proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.",
|
||||
|
||||
@ -2089,7 +2089,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
|
||||
<br>If set, verbose output will print a `.` no more than once a minute. This can be useful to avoid long-running Homebrew commands being killed due to no output.
|
||||
|
||||
- `HOMEBREW_SHELLENV_SET`
|
||||
<br>If set, `brew shellenv` skips export statements for paths.
|
||||
<br>A colon separated list of brew prefixes. If it is set and contains the current brew prefix, `brew shellenv` skips export statements for paths.
|
||||
|
||||
- `all_proxy`
|
||||
<br>Use this SOCKS5 proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BREW" "1" "July 2021" "Homebrew" "brew"
|
||||
.TH "BREW" "1" "August 2021" "Homebrew" "brew"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbrew\fR \- The Missing Package Manager for macOS (or Linux)
|
||||
@ -3043,7 +3043,7 @@ If set, verbose output will print a \fB\.\fR no more than once a minute\. This c
|
||||
\fBHOMEBREW_SHELLENV_SET\fR
|
||||
.
|
||||
.br
|
||||
If set, \fBbrew shellenv\fR skips export statements for paths\.
|
||||
A colon separated list of brew prefixes\. If it is set and contains the current brew prefix, \fBbrew shellenv\fR skips export statements for paths\.
|
||||
.
|
||||
.TP
|
||||
\fBall_proxy\fR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user