mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-13 08:38:43 +03:00
mv and rm.
This commit is contained in:
parent
139449b86c
commit
69f6b2bb91
@ -1212,6 +1212,26 @@
|
||||
?> ?=([* * * *] pax)
|
||||
[i.t.pax [%& ~ [*cart [[t.t.t.pax (feel pax val)] ~]]]]
|
||||
::
|
||||
++ fray :: high-level delete
|
||||
|= pax=path
|
||||
^- toro
|
||||
?> ?=([* * * *] pax)
|
||||
[i.t.pax [%& ~ [*cart [[t.t.t.pax [%del .^(%cx pax)]] ~]]]]
|
||||
::
|
||||
++ furl :: unify changes
|
||||
|= [one=toro two=toro] !:
|
||||
^- toro
|
||||
~| %furl
|
||||
?> ?& =(p.one p.two) :: same path
|
||||
&(?=(& -.q.one) ?=(& -.q.two)) :: both deltas
|
||||
&(?=(~ p.q.one) ?=(~ p.q.two)) :: not merges
|
||||
==
|
||||
:- p.one
|
||||
:+ %&
|
||||
~
|
||||
:- *cart
|
||||
(weld `(list tako)`q.q.q.one `(list tako)`q.q.q.two)
|
||||
::
|
||||
++ glam
|
||||
|= zar=@p ^- tape
|
||||
%+ snag zar
|
||||
|
10
main/bin/mv.hoon
Normal file
10
main/bin/mv.hoon
Normal file
@ -0,0 +1,10 @@
|
||||
!: :: /=main=/bin/mv/hoon
|
||||
!? 164
|
||||
::::
|
||||
|= *
|
||||
|= [input=path output=path ~]
|
||||
^- bowl
|
||||
::::
|
||||
:_ ~ :_ ~
|
||||
^- gift
|
||||
[%ok (furl (foal output .^(%cx input)) (fray input))]
|
15
main/bin/rm.hoon
Normal file
15
main/bin/rm.hoon
Normal file
@ -0,0 +1,15 @@
|
||||
!: :: /=main=/bin/rm/hoon
|
||||
!? 164
|
||||
::::
|
||||
|= *
|
||||
|= files=(list path)
|
||||
^- bowl
|
||||
::::
|
||||
:_ ~
|
||||
=+ cag=(turn files fray)
|
||||
?~ cag ~
|
||||
:_ ~
|
||||
:- %ok
|
||||
|- ^- toro
|
||||
?~ t.cag i.cag
|
||||
(furl i.t.cag $(t.cag t.t.cag))
|
Loading…
Reference in New Issue
Block a user