Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
d2dc3bd2
Unverified
Commit
d2dc3bd2
authored
Jul 12, 2022
by
Carlo Sala
Committed by
GitHub
Jul 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(brew): run `brew shellenv` command at plugin load (#10874)
parent
4c82a2ee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
7 deletions
+35
-7
README.md
plugins/brew/README.md
+8
-4
brew.plugin.zsh
plugins/brew/brew.plugin.zsh
+27
-3
No files found.
plugins/brew/README.md
View file @
d2dc3bd2
...
...
@@ -8,19 +8,23 @@ To use it, add `brew` to the plugins array of your zshrc file:
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`
.
## Aliases
| Alias | Command | Description |
|----------|---------------------------------------|---------------------------------------------------------------------|
| -------- | ------------------------------------- | ------------------------------------------------------------------- |
|
`bcubc`
|
`brew upgrade --cask && brew cleanup`
| Update outdated casks, then run cleanup. |
|
`bcubo`
|
`brew update && brew outdated --cask`
| Update Homebrew data, then list outdated casks. |
|
`brewp`
|
`brew pin`
| Pin a specified formula so that it's not upgraded. |
|
`brews`
|
`brew list -1`
| List installed formulae or the installed files for a given formula. |
|
`brewsp`
|
`brew list --pinned`
| List pinned formulae, or show the version of a given formula. |
|
`bubo`
|
`brew update && brew outdated`
| Update Homebrew data, then list outdated formulae and casks. |
|
`bubc`
|
`brew upgrade && brew cleanup`
| Upgrade outdated formulae and casks, then run cleanup. |
|
`bubo`
|
`brew update && brew outdated`
| Update Homebrew data, then list outdated formulae and casks. |
|
`bubu`
|
`bubo && bubc`
| Do the last two operations above. |
|
`buf`
|
`brew upgrade --formula`
| Upgrade only formulas (not casks). |
|
`bcubo`
|
`brew update && brew outdated --cask`
| Update Homebrew data, then list outdated casks. |
|
`bcubc`
|
`brew upgrade --cask && brew cleanup`
| Update outdated casks, then run cleanup. |
## Completion
...
...
plugins/brew/brew.plugin.zsh
View file @
d2dc3bd2
if
((
!
$+
commands[brew]
))
;
then
if
[[
-x
/opt/homebrew/bin/brew
]]
;
then
BREW_LOCATION
=
"/opt/homebrew/bin/brew"
elif
[[
-x
/usr/local/bin/brew
]]
;
then
BREW_LOCATION
=
"/usr/local/bin/brew"
elif
[[
-x
/home/linuxbrew/.linuxbrew/bin/brew
]]
;
then
BREW_LOCATION
=
"/home/linuxbrew/.linuxbrew/bin/brew"
elif
[[
-x
"
$HOME
/.linuxbrew/bin/brew"
]]
;
then
BREW_LOCATION
=
"
$HOME
/.linuxbrew/bin/brew"
else
return
fi
fi
if
[[
-z
"
$HOMEBREW_PREFIX
"
]]
;
then
if
[[
-z
$BREW_LOCATION
]]
;
then
eval
"
$(
brew shellenv
)
"
else
eval
"
$(
"
$BREW_LOCATION
"
shellenv
)
"
fi
fi
unset
BREW_LOCATION
alias
bcubc
=
'brew upgrade --cask && brew cleanup'
alias
bcubo
=
'brew update && brew outdated --cask'
alias
brewp
=
'brew pin'
alias
brewsp
=
'brew list --pinned'
alias
bubo
=
'brew update && brew outdated'
alias
bubc
=
'brew upgrade && brew cleanup'
alias
bubo
=
'brew update && brew outdated'
alias
bubu
=
'bubo && bubc'
alias
buf
=
'brew upgrade --formula'
alias
bcubo
=
'brew update && brew outdated --cask'
alias
bcubc
=
'brew upgrade --cask && brew cleanup'
function
brews
()
{
local
formulae
=
"
$(
brew leaves | xargs brew deps
--installed
--for-each
)
"
...
...
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