zshuper/functions/pacman.zsh

19 lines
462 B
Bash
Raw Normal View History

2016-06-19 04:11:34 +03:00
# Wrap pacman so you don't need to put sudo before
# Optionally use yaourt or pacaur
function pacman {
if [ ! -z "${NO_PACMAN_WRAP}" ]; then
sudo /usr/bin/pacman "$@"
return $?
fi
local ypath="$(command -v yaourt)"
local ppath="$(command -v pacaur)"
if [ ! -z "${ypath}" ]; then
${ypath} "$@"
elif [ ! -z "${ppath}" ]; then
${ppath} "$@"
else
sudo /usr/bin/pacman "$@"
fi
return $?
}