чување 456cfb75132e3a851f718e561feb97ff6298518f
родитељ 5b3660d83de85da06892df1c844b407c1e50e110
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sun, 10 Mar 2024 19:14:31 +0100
test/tree_readme.sh: Use pmpaste only under Busybox
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 1, додавања: 6(+), брисања: 2(-)
diff --git a/test/tree_readme.sh b/test/tree_readme.sh
@@ -2,12 +2,16 @@
# Requires:
# - table
# https://git.sr.ht/~strahinja/table/
-# - pmpaste
+# - working paste or pmpaste if using Busybox
# https://git.sr.ht/~strahinja/dotfiles/tree/master/item/bin/pmpaste
+case "$(file "$(which paste 2>/dev/null)" 2>/dev/null)" in
+ *busybox*) paste="pmpaste";;
+ *) paste="paste";;
+esac
dtree test/test-001.txt |
while IFS= read -r line; do
printf "%s%*s\n" "$line" $((40-${#line})) " "
done |
-pmpaste - README |
+"$paste" - README |
tsvtable -n -f1:5 -c123 -t |
less -S