dot

packages and services management
Log | Files | Refs | README

commit 1743de161b206dd98a1433d7978f21c3f73b0763
parent 9ec77c7b89d66166b07c96160ae5007fac402d8c
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 10 Jan 2018 01:25:46 +0100

ultra portable lt :D

Diffstat:
Mbin/lt | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/bin/lt b/bin/lt @@ -5,17 +5,16 @@ LC_COLLATE=C case $# in (0) ;; (1) cd "$1" || exit 1 ;; (*) exit 1 ;; esac -find . -name CVS -prune -o -name .git -prune -o \ - -exec stat -f '%Sp %11z%t%N/' {} + | sort -u -t ' ' -k 2 | -awk -v LINE='| ' -v NODE='|- ' -v TAIL='`- ' -v VOID=' ' ' +du -a | grep -v -e/CVS -e/.git | sort -k2 -t' ' | +awk -vLINE='| ' -vNODE='|- ' -vTAIL='`- ' -vVOID=' ' ' { - count = split($0, path_v, "/") - 1; + count = split($0, path_v, "/"); for (i = 2; i <= count; i++) line_v[NR":"i] = LINE; sub("\t.*", "", $0); line_v[NR":"i - 1] = NODE; - line_v[NR":"1] = $0 "\t" - line_v[NR"name"] = substr(path_v[count], index(path_v[count], "\t") + 1); + line_v[NR":"1] = sprintf("%10d ", $0); + line_v[NR"name"] = path_v[count]; } END {