This commit is contained in:
Mattias Andrée 2012-07-24 16:34:44 +02:00
parent c374d57fd3
commit 4e1655bc0b

12
ponysay
View file

@ -1,19 +1,23 @@
#!/usr/bin/env bash #!/usr/bin/env bash
version=1.1 version=1.1
SYSTEMPONIES="/usr/share/ponysay/ponies"
HOMEPONIES="${HOME}/.local/share/ponysay/ponies"
SCRIPTDIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get bash script directory SCRIPTDIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get bash script directory
pony="*" pony="*"
wrap="" wrap=""
SYSTEMPONIES="$(dirname $SCRIPTDIR)/share/ponysay"
HOMEPONIES="${HOME}/.local/share/ponysay"
kmscmd="" kmscmd=""
[[ "$TERM" = "linux" ]] && kmscmd=$(for c in $(echo $PATH":" | sed -e 's/:/\/ponysay2kmsponysay /g'); do if [[ -f $c ]]; then echo $c; break; fi done) [[ "$TERM" = "linux" ]] && kmscmd=$(for c in $(echo $PATH":" | sed -e 's/:/\/ponysay2kmsponysay /g'); do if [[ -f $c ]]; then echo $c; break; fi done)
[[ ! "$kmscmd" = "" ]] && TERM="-linux-" [[ ! "$kmscmd" = "" ]] && TERM="-linux-"
if [ "$TERM" = "linux" ]; then if [ "$TERM" = "linux" ]; then
SYSTEMPONIES="/usr/share/ponysay/ttyponies" SYSTEMPONIES="$SYSTEMPONIES/ttyponies"
HOMEPONIES="${HOME}/.local/share/ponysay/ttyponies" HOMEPONIES="$HOMEPONIES/ttyponies"
else
SYSTEMPONIES="$SYSTEMPONIES/ponies"
HOMEPONIES="$HOMEPONIES/ponies"
fi fi
if [[ "$PONYSAY_COWSAY" = "" ]]; then if [[ "$PONYSAY_COWSAY" = "" ]]; then