From 578c5b24a89f528685271c190ed6ed13fd16cc7b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 18 Aug 2012 15:25:20 +0200 Subject: make file update --- ponysay | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 ponysay (limited to 'ponysay') diff --git a/ponysay b/ponysay new file mode 100755 index 0000000..5664f16 --- /dev/null +++ b/ponysay @@ -0,0 +1,20 @@ +#!/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 -- cgit