zshuper/functions/pacman.zsh

19 lines
462 B
Bash

# 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 $?
}