urbit/gen/ls/subdir.hoon

25 lines
491 B
Plaintext
Raw Normal View History

2016-02-05 05:57:44 +03:00
::
2016-02-05 06:05:37 +03:00
:::: /hoon/subdir/ls/gen
2016-02-05 05:57:44 +03:00
::
/? 310
2015-05-28 05:46:58 +03:00
|%
++ subdir
|= {pax/path des/(map @t $~)}
2015-05-28 05:46:58 +03:00
^- tank
:+ %rose [" " `~]
%+ turn (sort (~(tap by des)) aor)
|= {kid/@ta $~}
2015-05-28 05:46:58 +03:00
=+ paf=`path`/[kid]
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
2016-02-12 00:53:14 +03:00
(turn paf |=(a/knot leaf+(trip a)))
|- ^- {dir/? paf/path}
2016-02-12 00:53:14 +03:00
=+ arf=.^(arch %cy (weld pax paf))
2015-09-08 23:15:40 +03:00
?^ fil.arf
2015-05-28 05:46:58 +03:00
[| paf]
2015-09-08 23:15:40 +03:00
?~ dir.arf
2015-05-28 05:46:58 +03:00
[& paf] :: !!
2016-02-12 00:53:14 +03:00
?. ?=({^ $~ $~} dir.arf)
2015-05-28 05:46:58 +03:00
[& paf]
2015-09-08 23:15:40 +03:00
$(paf (welp paf /[p.n.dir.arf]))
2015-05-28 05:46:58 +03:00
--