mirror of
https://github.com/MillironX/cowsay-cows.git
synced 2024-11-21 22:36:04 +00:00
Don't get in the user's way if cowsay isn't installed
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
parent
160539efea
commit
1d06f044ba
1 changed files with 17 additions and 23 deletions
|
@ -1,27 +1,21 @@
|
||||||
# Only add stuff if cowsay is installed
|
# Add default install cows to COWPATH
|
||||||
if [ $(command -v cowsay) ]; then
|
# Search for cows in $PREFIX/share/cows. According to the original repo
|
||||||
# Add default install cows to COWPATH
|
# (https://github.com/tnalpgge/rank-amateur-cowsay), this is the place to find
|
||||||
# Search for cows in $PREFIX/share/cows. According to the original repo
|
# cowfiles. Arch, local builds (including Homebrew) and Android/Termux are the
|
||||||
# (https://github.com/tnalpgge/rank-amateur-cowsay), this is the place to find
|
# only distros to stick with this location afaik
|
||||||
# cowfiles. Arch, local builds (including Homebrew) and Android/Termux are the
|
COWPATH=$COWPATH:$(dirname $(dirname $(command -v cowsay)))/share/cows
|
||||||
# only distros to stick with this location afaik
|
|
||||||
COWPATH=$COWPATH:$(dirname $(dirname $(command -v cowsay)))/share/cows
|
|
||||||
|
|
||||||
# Add the oddball cowfile locations
|
# Add the oddball cowfile locations
|
||||||
COWPATH=$COWPATH:/usr/share/cowsay # RHEL/Fedora
|
COWPATH=$COWPATH:/usr/share/cowsay # RHEL/Fedora
|
||||||
COWPATH=$COWPATH:/usr/share/cowsay/cows # Debian/Ubuntu
|
COWPATH=$COWPATH:/usr/share/cowsay/cows # Debian/Ubuntu
|
||||||
|
|
||||||
# Add the plugin's cows to COWPATH
|
# Add the plugin's cows to COWPATH
|
||||||
COWPATH=$(dirname $0):$COWPATH
|
COWPATH=$(dirname $0):$COWPATH
|
||||||
|
|
||||||
# COWPATH complete! Use it!
|
# COWPATH complete! Use it!
|
||||||
export COWPATH
|
export COWPATH
|
||||||
|
|
||||||
# Create some fun aliases
|
# Create some fun aliases
|
||||||
alias bullsay="cowsay -f bull"
|
alias bullsay="cowsay -f bull"
|
||||||
alias steersay="cowsay -f longhorn"
|
alias steersay="cowsay -f longhorn"
|
||||||
alias tuxsay="cowsay -f tux"
|
alias tuxsay="cowsay -f tux"
|
||||||
else
|
|
||||||
# Direct the user to install cowsay
|
|
||||||
alias cowsay="echo \"cowsay needs to be installed via apt, dnf, or the like\""
|
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in a new issue