From 5c09a46c0717765974557a41ea653c4964fb3f42 Mon Sep 17 00:00:00 2001 From: fang Date: Wed, 20 Oct 2021 11:40:57 -0500 Subject: [PATCH 1/2] hood: ask for confirmation during |nuke --- pkg/arvo/gen/hood/nuke.hoon | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/gen/hood/nuke.hoon b/pkg/arvo/gen/hood/nuke.hoon index 75bb07192..ae6d4e43a 100644 --- a/pkg/arvo/gen/hood/nuke.hoon +++ b/pkg/arvo/gen/hood/nuke.hoon @@ -1,6 +1,31 @@ -:- %say +:: |nuke: wipe agent state & subscriptions after confirmation +:: +/+ *generators +:- %ask |= $: [now=@da eny=@uvJ bec=beak] [=term ~] desk=_| == -[%kiln-nuke term desk] +=/ m1 + 'nuking agents will permanently delete all their state and subscriptions.' +=/ m2 + 'if other agents depend on the one(s) you nuke, \ + /their behavior could be negatively impacted.' +=/ m3 + %+ rap 3 + :~ 'are you sure you want to continue and nuke ' + :: + ?. desk (cat 3 '%' term) + (cat 3 'all agents in ' term) + :: + '?' + == +::NOTE yes, printing order is weird +%+ print m3 +%+ print m2 +%+ print m1 +%+ prompt [%& %prompt "nuke? (y/N) "] +|= in=tape +?. |(=("y" in) =("Y" in) =("yes" in)) + no-product +(produce %kiln-nuke term desk) From a7d707fa91c98ecf31bb5dc75a96fdcd68febad4 Mon Sep 17 00:00:00 2001 From: fang Date: Wed, 20 Oct 2021 14:15:50 -0500 Subject: [PATCH 2/2] hood: add non-interactive mode to |nuke Also improves the copy a bit. --- pkg/arvo/gen/hood/nuke.hoon | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/gen/hood/nuke.hoon b/pkg/arvo/gen/hood/nuke.hoon index ae6d4e43a..8cc54bffd 100644 --- a/pkg/arvo/gen/hood/nuke.hoon +++ b/pkg/arvo/gen/hood/nuke.hoon @@ -4,13 +4,16 @@ :- %ask |= $: [now=@da eny=@uvJ bec=beak] [=term ~] - desk=_| + [desk=_| hard=_|] == +?: hard (produce %kiln-nuke term desk) =/ m1 'nuking agents will permanently delete all their state and subscriptions.' =/ m2 'if other agents depend on the one(s) you nuke, \ - /their behavior could be negatively impacted.' + /their behavior could be negatively impacted. \ + /if you do not understand the risks, you may \ + /want to contact the agent\'s developers.' =/ m3 %+ rap 3 :~ 'are you sure you want to continue and nuke '