2012-07-21 15:43:21 +02:00
|
|
|
#!/usr/bin/env bash
|
2012-02-26 19:52:17 +01:00
|
|
|
|
2012-08-01 03:33:30 +02:00
|
|
|
|
|
|
|
# KMS ponies extension
|
2012-07-21 18:16:18 +02:00
|
|
|
kmscmd=""
|
2012-08-16 18:27:20 +02:00
|
|
|
[ "$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-"
|
2012-07-21 18:16:18 +02:00
|
|
|
|
2012-05-07 16:07:39 +02:00
|
|
|
|
2012-08-01 03:33:30 +02:00
|
|
|
# Function for printing the ponies and the message
|
2012-02-26 20:30:25 +01:00
|
|
|
say() {
|
2012-08-01 03:33:30 +02:00
|
|
|
# KMS ponies support
|
2012-08-16 18:27:20 +02:00
|
|
|
if [ "$kmscmd" = "" ]; then
|
2012-07-21 18:16:18 +02:00
|
|
|
function runcmd {
|
|
|
|
cowcmd -f "$pony" "$@"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
function runcmd {
|
|
|
|
cowcmd -f <($kmscmd "$pony") "$@"
|
|
|
|
}
|
|
|
|
fi
|
2012-08-01 03:33:30 +02:00
|
|
|
|
2012-02-26 20:30:25 +01:00
|
|
|
}
|