mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-22 20:38:00 +01:00
20 lines
517 B
Bash
Executable file
20 lines
517 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
INSTALLDIR="$(dirname $( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))"
|
|
truncatercmd="$INSTALLDIR/lib/ponysay/truncater"
|
|
|
|
scrw=`(stty size <&2 || echo 0 0) | cut -d ' ' -f 2` # Screen width
|
|
|
|
function wtrunc {
|
|
if [ "$PONYSAY_FULL_WIDTH" = 'yes' ] || [ "$PONYSAY_FULL_WIDTH" = 'y' ] || [ "$PONYSAY_FULL_WIDTH" = '1' ]; then
|
|
cat
|
|
else
|
|
if [[ -f $truncatercmd ]]; then
|
|
$truncatercmd $scrw
|
|
else
|
|
cat
|
|
fi
|
|
fi
|
|
}
|
|
|
|
"$0.py" "$@" | wtrunc
|