From 160539efea4a06d28f44ed56012790fb2e683f69 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 12 Oct 2021 15:07:03 -0500 Subject: [PATCH] Hard-code all known distro COWPATHs Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com> --- cowsay-cows.plugin.zsh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cowsay-cows.plugin.zsh b/cowsay-cows.plugin.zsh index 7ebe001..316c460 100644 --- a/cowsay-cows.plugin.zsh +++ b/cowsay-cows.plugin.zsh @@ -1,12 +1,21 @@ # Only add stuff if cowsay is installed if [ $(command -v cowsay) ]; then - # Add the originally present cows to COWPATH - for COW in $(find $(whereis cowsay | awk '{print $3}') -name "*.cow" | xargs dirname | uniq); do - export COWPATH=$COW:$COWPATH - done + # 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 - export COWPATH=$(dirname $0):$COWPATH + COWPATH=$(dirname $0):$COWPATH + + # COWPATH complete! Use it! + export COWPATH # Create some fun aliases alias bullsay="cowsay -f bull"