mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-04 13:19:48 +03:00
Merge pull request #5339 from urbit/m/nuke-carefully
hood: ask for confirmation during |nuke
This commit is contained in:
commit
895c7f82c0
@ -1,6 +1,34 @@
|
|||||||
:- %say
|
:: |nuke: wipe agent state & subscriptions after confirmation
|
||||||
|
::
|
||||||
|
/+ *generators
|
||||||
|
:- %ask
|
||||||
|= $: [now=@da eny=@uvJ bec=beak]
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
[=term ~]
|
[=term ~]
|
||||||
desk=_|
|
[desk=_| hard=_|]
|
||||||
==
|
==
|
||||||
[%kiln-nuke term desk]
|
?: 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. \
|
||||||
|
/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 '
|
||||||
|
::
|
||||||
|
?. 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)
|
||||||
|
Loading…
Reference in New Issue
Block a user