1
0
Fork 0
mirror of https://github.com/MillironX/cowsay-cows.git synced 2024-11-21 22:36:04 +00:00
cowsay-cows/cowsay-cows.plugin.zsh
Thomas A. Christensen II 160539efea
Hard-code all known distro COWPATHs
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2021-10-12 15:07:03 -05:00

27 lines
1,004 B
Bash

# Only add stuff if cowsay is installed
if [ $(command -v cowsay) ]; then
# Add default install cows to COWPATH
# Search for cows in $PREFIX/share/cows. According to the original repo
# (https://github.com/tnalpgge/rank-amateur-cowsay), this is the place to find
# cowfiles. Arch, local builds (including Homebrew) and Android/Termux are the
# only distros to stick with this location afaik
COWPATH=$COWPATH:$(dirname $(dirname $(command -v cowsay)))/share/cows
# Add the oddball cowfile locations
COWPATH=$COWPATH:/usr/share/cowsay # RHEL/Fedora
COWPATH=$COWPATH:/usr/share/cowsay/cows # Debian/Ubuntu
# Add the plugin's cows to COWPATH
COWPATH=$(dirname $0):$COWPATH
# COWPATH complete! Use it!
export COWPATH
# Create some fun aliases
alias bullsay="cowsay -f bull"
alias steersay="cowsay -f longhorn"
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