shrub/gen/ls/subdir.hoon
Raymond Pasco 309805f5e7 Merge in Hoon 151
Complicated merge of Hoon 151. This commit is a major sequence point.
2016-02-10 14:03:28 -05:00

24 lines
485 B
Plaintext

::
:::: /hoon/subdir/ls/gen
::
|%
++ subdir
|= {pax/path des/(map @t $~)}
^- tank
:+ %rose [" " `~]
%+ turn (sort (~(tap by des)) aor)
|= {kid/@ta $~}
=+ paf=`path`/[kid]
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
(turn paf |=(a/span leaf+(trip a)))
|- ^- {dir/? paf/path}
=+ arf=;;(arch .^(%cy (weld pax paf)))
?^ fil.arf
[| paf]
?~ dir.arf
[& paf] :: !!
?. ?+({^ $~ $~} dir.arf)
[& paf]
$(paf (welp paf /[p.n.dir.arf]))
--