Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
c7c0a891
Unverified
Commit
c7c0a891
authored
Oct 14, 2022
by
tmoschou
Committed by
GitHub
Oct 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(brew): do not source `brew shellenv` if already on path (#11167)
parent
34cd8fbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
README.md
plugins/brew/README.md
+4
-1
brew.plugin.zsh
plugins/brew/brew.plugin.zsh
+10
-7
No files found.
plugins/brew/README.md
View file @
c7c0a891
...
...
@@ -10,7 +10,10 @@ plugins=(... brew)
## Shellenv
This plugin also executes
`brew shellenv`
at plugin load to set up many useful variables, such as
`HOMEBREW_PREFIX`
or
`HOMEBREW_REPOSITORY`
.
If
`brew`
is not found in the PATH, this plugin will attempt to find it in common
locations, and execute
`brew shellenv`
to set the environment appropriately.
This plugin will also export
`HOMEBREW_PREFIX="$(brew --prefix)"`
if not previously
defined for convenience.
## Aliases
...
...
plugins/brew/brew.plugin.zsh
View file @
c7c0a891
...
...
@@ -10,18 +10,21 @@ if (( ! $+commands[brew] )); then
else
return
fi
# Only add Homebrew installation to PATH, MANPATH, and INFOPATH if brew is
# not already on the path, to prevent duplicate entries. This aligns with
# the behavior of the brew installer.sh post-install steps.
eval
"
$(
"
$BREW_LOCATION
"
shellenv
)
"
unset
BREW_LOCATION
fi
if
[[
-z
"
$HOMEBREW_PREFIX
"
]]
;
then
if
[[
-z
$BREW_LOCATION
]]
;
then
eval
"
$(
brew shellenv
)
"
else
eval
"
$(
"
$BREW_LOCATION
"
shellenv
)
"
fi
# Maintain compatability with potential custom user profiles, where we had
# previously relied on always sourcing shellenv. OMZ plugins should not rely
# on this to be defined due to out of order processing.
export
HOMEBREW_PREFIX
=
"
$(
brew
--prefix
)
"
fi
unset
BREW_LOCATION
alias
bcubc
=
'brew upgrade --cask && brew cleanup'
alias
bcubo
=
'brew update && brew outdated --cask'
alias
brewp
=
'brew pin'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment