aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-18 15:25:20 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-18 15:25:20 +0200
commit578c5b24a89f528685271c190ed6ed13fd16cc7b (patch)
tree66378863df3b358e566f676813e35c85e0787e45 /ponysay
parentce3fac588fb84a109244b9c3d60aba4fc247a86f (diff)
downloadponysay-578c5b24a89f528685271c190ed6ed13fd16cc7b.tar.gz
ponysay-578c5b24a89f528685271c190ed6ed13fd16cc7b.tar.bz2
ponysay-578c5b24a89f528685271c190ed6ed13fd16cc7b.zip
make file update
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay20
1 files changed, 20 insertions, 0 deletions
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