From 97a8aac322f51ab70664bbebc6f35304bc82d479 Mon Sep 17 00:00:00 2001 From: Joseph Bryan Date: Fri, 15 Jul 2016 21:56:50 -0400 Subject: [PATCH] adds error message for file-not-found on |cp, |mv, and |rm also adds an error message for mark changes --- app/hood.hoon | 2 ++ gen/hood/cp.hoon | 4 +--- gen/hood/mv.hoon | 5 +---- lib/kiln.hoon | 34 +++++++++++++++++++++++++++++++++- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/app/hood.hoon b/app/hood.hoon index e4ac5b005..7b4abec9f 100644 --- a/app/hood.hoon +++ b/app/hood.hoon @@ -136,6 +136,8 @@ ++ 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 69d550b28..8b46eb59e 100644 --- a/gen/hood/cp.hoon +++ b/gen/hood/cp.hoon @@ -4,6 +4,4 @@ /? 310 :- %say |= {^ {input/path output/path $~} $~} -:+ %kiln-info "copied" -?> =(-:(flop input) -:(flop output)) -(foal output -:(flop input) [%atom %t ~] .^(* %cx input)) :: XX type +[%kiln-cp input output] diff --git a/gen/hood/mv.hoon b/gen/hood/mv.hoon index 48da278e0..a7dd7e16c 100644 --- a/gen/hood/mv.hoon +++ b/gen/hood/mv.hoon @@ -4,7 +4,4 @@ /? 310 :- %say |= {^ {input/path output/path $~} $~} -:+ %kiln-info "moved" -?> =(-:(flop input) -:(flop output)) -%+ furl (fray input) -(foal output -:(flop input) [%noun .^(* %cx input)]) +[%kiln-mv input output] diff --git a/lib/kiln.hoon b/lib/kiln.hoon index d7d5d2f4f..24b6a3ab9 100644 --- a/lib/kiln.hoon +++ b/lib/kiln.hoon @@ -157,7 +157,39 @@ |= {mez/tape tor/toro} abet:(emit:(spam leaf+mez ~) %info /kiln our tor) :: -++ poke-rm |=(a/path (poke-info "removed" (fray a))) +++ 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) + ?~ fil.b + =+ ~[leaf+"No such file:" leaf+"{}"] + abet:(spam -) + (poke-info "removed" (fray a)) +:: ++ poke-label |= {syd/desk lab/@tas} =+ pax=/(scot %p our)/[syd]/[lab]