urbit/main/bin/tree.hoon
2014-08-07 14:25:53 -07:00

15 lines
320 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 (~(tap by r.ark))
|=([a=@t ~] ^$(pax (weld pax `path`/[a])))