mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-21 23:47:35 +03:00
Factored out gate-class poke functionality
This commit is contained in:
parent
6f8a2ca9c8
commit
3f6e417a4a
@ -1,39 +1,30 @@
|
||||
// /%%%/ls/subdir
|
||||
// /===/lib/sh-utils
|
||||
!:
|
||||
|_ [hid=hide ~]
|
||||
++ poke-cat-args
|
||||
|= [ost=bone you=ship arg=(list path)]
|
||||
:_ +>.$
|
||||
:* [ost %pass / %g %cide %$]
|
||||
[ost %give %nice ~]
|
||||
%+ turn (~(tap by sup.hid))
|
||||
|= [ost=bone *]
|
||||
:^ ost %give %rush
|
||||
:- %tang
|
||||
%- flop
|
||||
^- (list tank)
|
||||
%- zing
|
||||
%+ turn arg
|
||||
|= pax=path
|
||||
^- (list tank)
|
||||
=+ ark=;;(arch .^(%cy pax))
|
||||
?^ q.ark
|
||||
:- leaf/(spud pax)
|
||||
%+ turn (lore ;;(@t .^(%cx pax)))
|
||||
|= a=cord
|
||||
leaf/(trip a)
|
||||
?- r.ark
|
||||
~
|
||||
[rose/[" " `~]^~[leaf/"~" (smyt pax)]]~
|
||||
[[@t ~] ~ ~]
|
||||
$(pax (welp pax /[p.n.r.ark]))
|
||||
*
|
||||
=- [palm/[": " ``~]^-]~
|
||||
:~ rose/[" " `~]^~[leaf/"*" (smyt pax)]
|
||||
`tank`(subdir pax r.ark)
|
||||
==
|
||||
== ==
|
||||
::
|
||||
%+ args-into-gate .
|
||||
|= [arg=(list path)]
|
||||
=- tang/(flop `(list tank)`(zing -))
|
||||
%+ turn arg
|
||||
|= pax=path
|
||||
^- (list tank)
|
||||
=+ ark=;;(arch .^(%cy pax))
|
||||
?^ q.ark
|
||||
:- leaf/(spud pax)
|
||||
%+ turn (lore ;;(@t .^(%cx pax)))
|
||||
|=(a=cord leaf/(trip a))
|
||||
?- r.ark :: handle ambiguity
|
||||
~
|
||||
[rose/[" " `~]^~[leaf/"~" (smyt pax)]]~
|
||||
[[@t ~] ~ ~]
|
||||
$(pax (welp pax /[p.n.r.ark]))
|
||||
*
|
||||
=- [palm/[": " ``~]^-]~
|
||||
:~ rose/[" " `~]^~[leaf/"*" (smyt pax)]
|
||||
`tank`(subdir pax r.ark)
|
||||
==
|
||||
==
|
||||
++ peer
|
||||
|=
|
||||
*
|
||||
|
@ -1,19 +1,12 @@
|
||||
// /%%/subdir
|
||||
// /===/lib/sh-utils
|
||||
!:
|
||||
|_ [hid=hide ~]
|
||||
++ poke-ls-args
|
||||
|= [ost=bone you=ship arg=path ~]
|
||||
%+ args-into-gate .
|
||||
|= [arg=path ~]
|
||||
=+ lon=((hard arch) .^(%cy arg))
|
||||
:_ +>.$
|
||||
:* [ost %pass / %g %cide %$]
|
||||
[ost %give %nice ~]
|
||||
%+ turn (~(tap by sup.hid))
|
||||
|= [ost=bone *]
|
||||
:^ ost %give %rush
|
||||
:- %tang
|
||||
:_ ~
|
||||
(subdir arg r.lon)
|
||||
==
|
||||
tang/[?~(r.lon leaf/"~" (subdir arg r.lon))]~
|
||||
++ peer
|
||||
|=
|
||||
*
|
||||
|
@ -1,26 +1,21 @@
|
||||
// /===/lib/sh-utils
|
||||
!:
|
||||
|_ [hid=hide ~]
|
||||
++ poke-tree-args
|
||||
|= [ost=bone you=ship pax=path fla=$|(~ [%full ~])]
|
||||
:_ +>.$
|
||||
:* [ost %pass / %g %cide %$]
|
||||
[ost %give %nice ~]
|
||||
%+ turn (~(tap by sup.hid))
|
||||
|= [ost=bone *]
|
||||
:^ ost %give %rush
|
||||
:- %tang
|
||||
=+ len=(lent pax)
|
||||
=+ rend=?^(fla dank:ut |=(a=path (dank:ut (slag len a))))
|
||||
|- ^- (list tank)
|
||||
=+ ark=;;(arch .^(cy/pax))
|
||||
=- ?~ q.ark -
|
||||
[(rend pax) -]
|
||||
%- zing
|
||||
%+ turn
|
||||
(sort (~(tap by r.ark)) aor)
|
||||
|= [a=@t ~]
|
||||
^$(pax (welp pax /[a]))
|
||||
==
|
||||
%+ args-into-gate .
|
||||
|= [pax=path fla=$|(~ [%full ~])]
|
||||
=+ len=(lent pax)
|
||||
=+ rend=?^(fla dank:ut |=(a=path (dank:ut (slag len a))))
|
||||
:- %tang
|
||||
|- ^- (list tank)
|
||||
=+ ark=;;(arch .^(cy/pax))
|
||||
=- ?~ q.ark -
|
||||
[(rend pax) -]
|
||||
%- zing
|
||||
%+ turn
|
||||
(sort (~(tap by r.ark)) aor)
|
||||
|= [a=@t ~]
|
||||
^$(pax (welp pax /[a]))
|
||||
++ peer
|
||||
|=
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user