urbit/main/bin/tree.hoon
2014-09-03 00:20:08 -07:00

17 lines
367 B
Plaintext

!:
:: /===/bin/tree/hoon
|= ^
|= [pax=path fla=$|(~ [%full ~])]
=- ~[te/-]~
=+ len=(lent pax)
=+ rend=?~(fla |=(a=path +:(spud (slag len a))) spud)
|- ^- wain
=+ ark=;;(arch .^(cy/pax))
=- ?~ q.ark -
[(crip (rend pax)) -]
%- zing
%- turn :_ |=(a=@t ^$(pax (weld pax `path`/[a])))
%- sort :_ aor
%- turn :_ |=([a=@t ~] a)
(~(tap by r.ark))