added to check if cowsay exists, also readme

This commit is contained in:
Erkin Batu Altunbaş 2012-03-11 23:04:18 +01:00
parent 6fd482e773
commit d4e4715cae
2 changed files with 16 additions and 4 deletions

View file

@ -1,5 +1,9 @@
ponysay - A cowsay wrapper with ponies. ponysay - A cowsay wrapper with ponies.
These are desktop ponies converted using https://github.com/ducttape/ducttape-editor/wiki The original author of the cowfiles is unknown.
(But we are told that the artist is known as "Rossy". If you are the artist, we'd appreciate if you contact us before you sue us.)
These are desktop ponies converted using [ducttape](https://github.com/ducttape/ducttape-editor/wiki)
![Derp](http://i.imgur.com/xOJbE.png) ![Derp](http://i.imgur.com/xOJbE.png)
[](/derp "Today your terminal, tomorrow the world!") [](/derp "Today your terminal, tomorrow the world!")

14
ponysay
View file

@ -1,11 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
version=0.4 version=0.5
SYSTEMPONIES=/usr/share/ponies SYSTEMPONIES=/usr/share/ponies
HOMEPONIES="${HOME}/.ponies" HOMEPONIES="${HOME}/.ponies"
pony="*" pony="*"
wrap= wrap=
if [[ -f `which cowsay` ]];
then continue;
else
echo "You don't seem to have the cowsay program."
echo "Please install it in order to use this wrapper."
echo -n "(Or symlink it to 'cowsay' in anywhere in \$path "
echo "if it actually exists under a different filename."
fi
cmd=cowsay cmd=cowsay
[[ ${0} == *ponythink ]] && cmd=cowthink [[ ${0} == *ponythink ]] && cmd=cowthink
@ -15,8 +24,7 @@ version() {
usage() { usage() {
version version
echo echo -e "\nUsage:"
echo "Usage:"
echo "${0##*/} [options] [message]" echo "${0##*/} [options] [message]"
echo echo
echo "If [message] is not provided, reads the message from STDIN" echo "If [message] is not provided, reads the message from STDIN"