From c800b7f48943a51be55de433c2be3a8b558d60a5 Mon Sep 17 00:00:00 2001 From: Joseph Bryan Date: Sat, 16 Jul 2016 00:19:49 -0400 Subject: [PATCH] moves |cp and |mv implementations back into the generators --- app/hood.hoon | 2 -- gen/hood/cp.hoon | 11 ++++++++++- gen/hood/mv.hoon | 12 +++++++++++- lib/kiln.hoon | 25 ------------------------- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/app/hood.hoon b/app/hood.hoon index 7b4abec9f..e4ac5b005 100644 --- a/app/hood.hoon +++ b/app/hood.hoon @@ -136,8 +136,6 @@ ++ poke-kiln-merge (wrap poke-merge):from-kiln ++ poke-kiln-cancel (wrap poke-cancel):from-kiln ++ poke-kiln-mount (wrap poke-mount):from-kiln -++ poke-kiln-cp (wrap poke-cp):from-kiln -++ poke-kiln-mv (wrap poke-mv):from-kiln ++ poke-kiln-rm (wrap poke-rm):from-kiln ++ poke-kiln-schedule (wrap poke-schedule):from-kiln ++ poke-kiln-track (wrap poke-track):from-kiln diff --git a/gen/hood/cp.hoon b/gen/hood/cp.hoon index 8b46eb59e..925f07dc8 100644 --- a/gen/hood/cp.hoon +++ b/gen/hood/cp.hoon @@ -4,4 +4,13 @@ /? 310 :- %say |= {^ {input/path output/path $~} $~} -[%kiln-cp input output] +?. =(-:(flop input) -:(flop output)) + ~& "Can't move to a different mark" + ~ +=+ dir=.^(arch %cy input) +?~ fil.dir + ~& "No such file:" + ~& + ~ +:+ %kiln-info "copied" +(foal output -:(flop input) [%atom %t ~] .^(* %cx input)) :: XX type diff --git a/gen/hood/mv.hoon b/gen/hood/mv.hoon index a7dd7e16c..1faf37fea 100644 --- a/gen/hood/mv.hoon +++ b/gen/hood/mv.hoon @@ -4,4 +4,14 @@ /? 310 :- %say |= {^ {input/path output/path $~} $~} -[%kiln-mv input output] +?. =(-:(flop input) -:(flop output)) + ~& "Can't move to a different mark" + ~ +=+ dir=.^(arch %cy input) +?~ fil.dir + ~& "No such file:" + ~& + ~ +:+ %kiln-info "moved" +%+ furl (fray input) +(foal output -:(flop input) [%noun .^(* %cx input)]) diff --git a/lib/kiln.hoon b/lib/kiln.hoon index 24b6a3ab9..7fb381634 100644 --- a/lib/kiln.hoon +++ b/lib/kiln.hoon @@ -157,31 +157,6 @@ |= {mez/tape tor/toro} abet:(emit:(spam leaf+mez ~) %info /kiln our tor) :: -++ poke-cp - |= {a/path b/path} - ?. =(-:(flop a) -:(flop b)) - =+ ~[leaf+"Can't copy to a different mark"] - abet:(spam -) - =+ c=.^(arch %cy a) - ?~ fil.c - =+ ~[leaf+"No such file:" leaf+"{}"] - abet:(spam -) - %+ poke-info "copied" - (foal b -:(flop a) [%atom %t ~] .^(* %cx a)) :: XX type -:: -++ poke-mv - |= {a/path b/path} - ?. =(-:(flop a) -:(flop b)) - =+ ~[leaf+"Can't move to a different mark"] - abet:(spam -) - =+ c=.^(arch %cy a) - ?~ fil.c - =+ ~[leaf+"No such file:" leaf+"{}"] - abet:(spam -) - %+ poke-info "moved" - %+ furl (fray a) - (foal b -:(flop a) [%noun .^(* %cx a)]) -:: ++ poke-rm |= a/path =+ b=.^(arch %cy a)