Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
d988ee01
Commit
d988ee01
authored
Dec 15, 2015
by
Marc Cornellà
Browse files
Merge pull request #4568 from blueyed/archlinux-improve-commands-lookup
archlinux: use $+commands instead of 'command -v' in a subshell
parents
531789e4
9e4aba4c
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/archlinux/archlinux.plugin.zsh
View file @
d988ee01
...
...
@@ -2,7 +2,7 @@
# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
# Look for yaourt, and add some useful functions if we have it.
if
[[
-x
`
command
-v
yaourt
`
]]
;
then
if
((
$+
command
s[
yaourt
]
))
;
then
upgrade
()
{
yaourt
-Syu
}
...
...
@@ -21,11 +21,11 @@ if [[ -x `command -v yaourt` ]]; then
alias
yalst
=
'yaourt -Qe'
# List installed packages, even those installed from AUR (they're tagged as "local")
alias
yaorph
=
'yaourt -Qtd'
# Remove orphans using yaourt
# Additional yaourt alias examples
if
[[
-x
`
command
-v
abs
`
&&
-x
`
command
-v
aur
`
]]
;
then
if
((
$+
command
s[
abs
]
&&
$+
command
s[aur]
))
;
then
alias
yaupd
=
'yaourt -Sy && sudo abs && sudo aur'
# Update and refresh the local package, ABS and AUR databases against repositories
elif
[[
-x
`
command
-v
abs
`
]]
;
then
elif
((
$+
commands[abs]
))
;
then
alias
yaupd
=
'yaourt -Sy && sudo abs'
# Update and refresh the local package and ABS databases against repositories
elif
[[
-x
`
command
-v
aur
`
]]
;
then
elif
((
$+
commands[aur]
))
;
then
alias
yaupd
=
'yaourt -Sy && sudo aur'
# Update and refresh the local package and AUR databases against repositories
else
alias
yaupd
=
'yaourt -Sy'
# Update and refresh the local package database against repositories
...
...
@@ -49,11 +49,11 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori
alias
pacloc
=
'pacman -Qi'
# Display information about a given package in the local database
alias
paclocs
=
'pacman -Qs'
# Search for package(s) in the local database
# Additional pacman alias examples
if
[[
-x
`
command
-v
abs
`
&&
-x
`
command
-v
aur
`
]]
;
then
if
((
$+
command
s[
abs
]
&&
$+
command
s[aur]
))
;
then
alias
pacupd
=
'sudo pacman -Sy && sudo abs && sudo aur'
# Update and refresh the local package, ABS and AUR databases against repositories
elif
[[
-x
`
command
-v
abs
`
]]
;
then
elif
((
$+
commands[abs]
))
;
then
alias
pacupd
=
'sudo pacman -Sy && sudo abs'
# Update and refresh the local package and ABS databases against repositories
elif
[[
-x
`
command
-v
aur
`
]]
;
then
elif
((
$+
commands[aur]
))
;
then
alias
pacupd
=
'sudo pacman -Sy && sudo aur'
# Update and refresh the local package and AUR databases against repositories
else
alias
pacupd
=
'sudo pacman -Sy'
# Update and refresh the local package database against repositories
...
...
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