1
0
Fork 0
mirror of https://github.com/MillironX/cowsay-cows.git synced 2024-11-27 00:39:56 +00:00

Convert to ZSH plugin

This commit is contained in:
Thomas A. Christensen II 2021-05-26 15:50:48 -05:00
parent 5d075cb843
commit 1a4f34cdff
Signed by: millironx
GPG key ID: 139C07724802BC5D
3 changed files with 78 additions and 28 deletions

View file

@ -1,13 +1,19 @@
# cowsay-cows
cowfiles in the original spirit of cowsay, except that all of these are
actually bovine
cowfiles in the original spirit of cowsay, except that all of these are actually bovine
Install using [Antigen](https://github.com/zsh-users/antigen)
```bash
antigen bundle millironx/cowsaycows
```
## Examples
### bell
```plaintext
```shellsession
$ cowsay -f bell
_______________________________________
/ The hills are alive with the sound of \
\ moo-sic /
@ -27,7 +33,8 @@ cowfiles in the original spirit of cowsay, except that all of these are
### birdstale
```plaintext
```shellsession
$ cowsay -f birdstale
_______________________________________
/ Grandpa said there was a moral there, \
| but you had to figure it out for |
@ -42,7 +49,8 @@ cowfiles in the original spirit of cowsay, except that all of these are
### bull
```plaintext
```shellsession
$ cowsay -f bull
______________________
< Actually, I'm a bull >
----------------------
@ -53,9 +61,12 @@ cowfiles in the original spirit of cowsay, except that all of these are
|| ||
```
**BONUS**: aliased to `bullsay`
### compucow
```plaintext
```shellsession
$ cowsay -f compucow
_______________________________________
/ The programmers number one excuse for \
\ slacking off: cow-pie-ling /
@ -76,7 +87,8 @@ cowfiles in the original spirit of cowsay, except that all of these are
### cownterfeit
```plaintext
```shellsession
$ cowsay -f cownterfeit
________________________________________
/ The love of moo-lah is the root of all \
\ evil /
@ -100,7 +112,8 @@ cowfiles in the original spirit of cowsay, except that all of these are
### cowpooling
```plaintext
```shellsession
$ cowsay -f cowpooling
_______________________________________
/ Maybe Al Gore will forgive us for all \
\ those methane emissions this way /
@ -119,7 +132,8 @@ _______| /\_| /\_| /\_| /\_| |________
### cowstruction
```plaintext
```shellsession
$ cowsay -f cowstruction
_________________________________
< My favorite part is bull-dozing >
---------------------------------
@ -147,10 +161,11 @@ _______| /\_| /\_| /\_| /\_| |________
### longhorn
```plaintext
```shellsession
$ cowsay -f longhorn
_______________________________________
/ I've been sent to spread the message: \
\ God bless Texas! /
\ God blessed Texas! /
---------------------------------------
\
\ \ /
@ -163,9 +178,12 @@ _______| /\_| /\_| /\_| /\_| |________
Texas Longhorn Steer
```
**BONUS**: aliased to `steersay`
### papal
```plaintext
```shellsession
$ cowsay -f papal
________________________
< I forgive you, my calf >
------------------------
@ -184,7 +202,8 @@ _______| /\_| /\_| /\_| /\_| |________
### pie
```plaintext
```shellsession
$ cowsay -f pie
___________________________________
< Nobody makes them like Aunt Aggie >
-----------------------------------
@ -198,7 +217,8 @@ _______| /\_| /\_| /\_| /\_| |________
### resting
```plaintext
```shellsession
$ cowthink -f resting
______________________________________
( Insert deep thoughts and ruminations )
( here )
@ -214,7 +234,8 @@ _______| /\_| /\_| /\_| /\_| |________
### super
```plaintext
```shellsession
$ cowsay -f super
________________________________________
/ If Impossible is as good as beef, then \
\ Bizarro is as good as me /

18
cowsay-cows.plugin.zsh Normal file
View file

@ -0,0 +1,18 @@
# 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 the plugin's cows to COWPATH
export COWPATH=$(dirname $0):$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

37
samples.sh Normal file → Executable file
View file

@ -3,8 +3,13 @@
{
echo "# cowsay-cows"
echo ""
echo "cowfiles in the original spirit of cowsay, except that all of these are
actually bovine"
echo "cowfiles in the original spirit of cowsay, except that all of these are actually bovine"
echo ""
echo "Install using [Antigen](https://github.com/zsh-users/antigen)"
echo ""
echo "\`\`\`bash"
echo "antigen bundle millironx/cowsaycows"
echo "\`\`\`"
echo ""
echo "## Examples"
echo ""
@ -17,7 +22,8 @@ cowsay_message() {
{
echo "### $COW"
echo ""
echo "\`\`\`plaintext"
echo "\`\`\`shellsession"
echo "\$ cowsay -f $COW"
cowsay -f "$COW" "$MESSAGE"
echo "\`\`\`"
echo ""
@ -31,7 +37,8 @@ cowthink_message() {
{
echo "### $COW"
echo ""
echo "\`\`\`plaintext"
echo "\`\`\`shellsession"
echo "\$ cowthink -f $COW"
cowthink -f "$COW" "$MESSAGE"
echo "\`\`\`"
echo ""
@ -39,18 +46,22 @@ cowthink_message() {
}
cowsay_message bell "The hills are alive with the sound of moo-sic"
cowsay_message birdstale "Grandpa said there was a moral there, but you had to
figure it out for yourself"
cowsay_message birdstale "Grandpa said there was a moral there, but you had to figure it out for yourself"
cowsay_message bull "Actually, I'm a bull"
cowsay_message compucow "The programmers number one excuse for slacking off:
cow-pie-ling"
{
echo "**BONUS**: aliased to \`bullsay\`"
echo ""
} >> README.md
cowsay_message compucow "The programmers number one excuse for slacking off: cow-pie-ling"
cowsay_message cownterfeit "The love of moo-lah is the root of all evil"
cowsay_message cowpooling "Maybe Al Gore will forgive us for all those methane
emissions this way"
cowsay_message cowpooling "Maybe Al Gore will forgive us for all those methane emissions this way"
cowsay_message cowstruction "My favorite part is bull-dozing"
cowsay_message longhorn "I've been sent to spread the message: God bless Texas!"
cowsay_message longhorn "I've been sent to spread the message: God blessed Texas!"
{
echo "**BONUS**: aliased to \`steersay\`"
echo ""
} >> README.md
cowsay_message papal "I forgive you, my calf"
cowsay_message pie "Nobody makes them like Aunt Aggie"
cowthink_message resting "Insert deep thoughts and ruminations here"
cowsay_message super "If Impossible is as good as beef, then Bizarro is as good
as me"
cowsay_message super "If Impossible is as good as beef, then Bizarro is as good as me"