mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 03:00:15 +03:00
move "XX moveme to lib/" // generator-bits to lib
This commit is contained in:
parent
212f58368f
commit
10754dc172
@ -3,8 +3,7 @@
|
||||
:::: /hoon/cat/gen
|
||||
::
|
||||
/? 310
|
||||
// /%%/ls/subdir
|
||||
// /%/pretty
|
||||
/+ pretty-file, show-dir
|
||||
::
|
||||
::::
|
||||
::
|
||||
@ -29,6 +28,6 @@
|
||||
*
|
||||
=- [palm+[": " ``~]^-]~
|
||||
:~ rose+[" " `~]^~[leaf+"*" (smyt pax)]
|
||||
`tank`(subdir vane pax dir.ark)
|
||||
`tank`(show-dir vane pax dir.ark)
|
||||
==
|
||||
==
|
||||
|
@ -3,7 +3,7 @@
|
||||
:::: /hoon/ls/gen
|
||||
::
|
||||
/? 310
|
||||
// /%/subdir
|
||||
/+ show-dir
|
||||
::
|
||||
::::
|
||||
::
|
||||
@ -11,4 +11,4 @@
|
||||
:- %say
|
||||
|= {^ {arg/path $~} vane/?($g $c)}
|
||||
=+ lon=.^(arch (cat 3 vane %y) arg)
|
||||
tang+[?~(dir.lon leaf+"~" (subdir vane arg dir.lon))]~
|
||||
tang+[?~(dir.lon leaf+"~" (show-dir vane arg dir.lon))]~
|
||||
|
@ -1,25 +0,0 @@
|
||||
:: Filesystem iterator XX move to lib/
|
||||
::
|
||||
:::: /hoon/subdir/ls/gen
|
||||
::
|
||||
/? 310
|
||||
|%
|
||||
++ subdir
|
||||
|= {vane/?($g $c) pax/path des/(map @t $~)}
|
||||
^- tank
|
||||
:+ %rose [" " `~]
|
||||
%+ turn (sort ~(tap by des) aor)
|
||||
|= {kid/@ta $~}
|
||||
=+ paf=`path`/[kid]
|
||||
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
|
||||
(turn paf |=(a/knot leaf+(trip a)))
|
||||
|- ^- {dir/? paf/path}
|
||||
=+ arf=.^(arch (cat 3 vane %y) (weld pax paf))
|
||||
?^ fil.arf
|
||||
[| paf]
|
||||
?~ dir.arf
|
||||
[& paf] :: !!
|
||||
?. ?=({^ $~ $~} dir.arf)
|
||||
[& paf]
|
||||
$(paf (welp paf /[p.n.dir.arf]))
|
||||
--
|
@ -1,9 +1,10 @@
|
||||
:: Pretty-printing util, should be in lib/
|
||||
:: Untyped best-guess printer
|
||||
::
|
||||
:::: /hoon/pretty/cat/gen
|
||||
:::: /hoon/pretty-file/lib
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
=< pretty-file
|
||||
|%
|
||||
++ pretty-noun
|
||||
|= pri/* ^- tank
|
||||
@ -21,8 +22,8 @@
|
||||
::
|
||||
++ vale-cord |=(a/cord `?`(levy (trip a) |=(b/@ |((gte b 32) =(10 b)))))
|
||||
::
|
||||
++ wain-to-tang |=(a/wain (turn a |=(b/cord leaf+(trip b))))
|
||||
++ pretty-file
|
||||
=+ wain-to-tang=|=(a/wain (turn a |=(b/cord leaf+(trip b))))
|
||||
|= fyl/* ^- tang
|
||||
=+ `(unit wain)`?@(fyl `(to-wain:format fyl) ((soft wain) fyl))
|
||||
?^ - (wain-to-tang u)
|
22
lib/show-dir.hoon
Normal file
22
lib/show-dir.hoon
Normal file
@ -0,0 +1,22 @@
|
||||
:: Display directory contents
|
||||
::
|
||||
:::: /hoon/show-dir/lib
|
||||
::
|
||||
/? 310
|
||||
|= {vane/?($g $c) pax/path des/(map @t $~)}
|
||||
^- tank
|
||||
:+ %rose [" " `~]
|
||||
%+ turn (sort ~(tap by des) aor)
|
||||
|= {kid/@ta $~}
|
||||
=+ paf=`path`/[kid]
|
||||
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
|
||||
(turn paf |=(a/knot leaf+(trip a)))
|
||||
|- ^- {dir/? paf/path}
|
||||
=+ arf=.^(arch (cat 3 vane %y) (weld pax paf))
|
||||
?^ fil.arf
|
||||
[| paf]
|
||||
?~ dir.arf
|
||||
[& paf] :: !!
|
||||
?. ?=({^ $~ $~} dir.arf)
|
||||
[& paf]
|
||||
$(paf (welp paf /[p.n.dir.arf]))
|
Loading…
Reference in New Issue
Block a user