landscape/desk/ted/make-glob.hoon
Liam Fitzgerald 312b06a0e2 -make-glob: url encode clay built globs
This isn't supposed to work, but the check in the runtime is faulty. We
fix it here for backwards compatiblity.
2023-12-06 14:59:52 -05:00

32 lines
832 B
Plaintext

/- spider, docket
/+ strandio
=, strand=strand:spider
^- thread:spider
|= arg=vase
=/ m (strand ,vase)
^- form:m
=+ !<([~ [=desk dir=path]] arg)
;< =bowl:spider bind:m get-bowl:strandio
=/ home=path /(scot %p our.bowl)/[desk]/(scot %da now.bowl)
=+ .^(paths=(list path) %ct (weld home dir))
=/ =glob:docket
%- ~(gas by *glob:docket)
%+ turn paths
|= pax=path
^- [path mime]
:-
?> ?=(^ pax)
%+ turn t.pax
|= seg=@t
^- @t
(crip (en-urlt:html (trip seg)))
=/ mar=mark (rear pax)
=+ .^(vas=vase %cr (weld home pax))
=+ .^(=tube:clay %cc (weld home /[mar]/mime))
!<(mime (tube vas))
=/ =path /(cat 3 'glob-' (scot %uv (sham glob)))/glob
~& globbed+`(set ^path)`~(key by glob)
;< ~ bind:m (poke-our:strandio %hood drum-put+!>([path (jam glob)]))
(pure:m *vase)