Files
kewt/awk/collect_dir_info.awk
N0\A c5a9355871
All checks were successful
Lint / shellcheck (push) Successful in 18s
Publish kewt-git to AUR / publish-aur-git (push) Successful in 30s
Release Standalone Builder / build (release) Successful in 31s
Release Standalone Builder / publish-aur (release) Successful in 34s
fix: config slashes
2026-03-19 21:45:38 +01:00

29 lines
435 B
Awk

BEGIN {
src = ENVIRON["AWK_SRC"]
slen = length(src)
}
{
if (length($0) <= slen) {
next
}
rel = substr($0, slen + 2)
parent = rel
if (sub(/\/[^\/]+$/, "", parent) == 0) {
parent = "."
}
all[parent]++
if (is_dir[rel]) {
dirs[parent]++
}
is_dir[parent] = 1
}
END {
for (parent in all) {
printf "%s|%d|%d\n", parent, all[parent], dirs[parent]
}
}