mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Changed which to command for more accurate results.
This commit is contained in:
parent
b6ea876971
commit
01af87a1f7
1 changed files with 12 additions and 2 deletions
|
|
@ -4,16 +4,26 @@
|
|||
#
|
||||
# Debian-related zsh aliases and functions for zsh
|
||||
|
||||
# Function to check if a command exists
|
||||
exists() {
|
||||
if command -v $1 >/dev/null 2>&1
|
||||
then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Use aptitude if installed, or apt-get if not.
|
||||
# You can just set apt_pref='apt-get' to override it.
|
||||
if [[ -e $( which aptitude 2>&1 ) ]]; then
|
||||
if exists aptitude; then
|
||||
apt_pref='aptitude'
|
||||
else
|
||||
apt_pref='apt-get'
|
||||
fi
|
||||
|
||||
# Use sudo by default if it's installed
|
||||
if [[ -e $( which sudo 2>&1 ) ]]; then
|
||||
if exists sudo; then
|
||||
use_sudo=1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue