mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-14 04:19:22 +03:00
adds warnings and a confirmation prompt to %/gen/moon
This commit is contained in:
parent
43bb99b61b
commit
f9fe3b644e
@ -3,18 +3,35 @@
|
||||
:::: /hoon/moon/gen
|
||||
::
|
||||
/? 310
|
||||
/- sole
|
||||
[. sole]
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
:- %ask
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
$~
|
||||
$~
|
||||
==
|
||||
:- %tang :_ ~ :- %leaf
|
||||
=+ ran=(clan p.bec)
|
||||
=/ ran (clan p.bec)
|
||||
?: ?=({?($earl $pawn)} ran)
|
||||
"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
||||
=+ mon=(mix (lsh 5 1 (end 5 1 eny)) p.bec)
|
||||
=+ tic=.^(@ /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon))
|
||||
"moon: {<`@p`mon>}; ticket: {<`@p`tic>}"
|
||||
%- sole-so
|
||||
:- %tang :_ ~
|
||||
leaf+"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
||||
=/ mon (mix (lsh 5 1 (end 5 1 eny)) p.bec)
|
||||
=/ tic .^(@ /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon))
|
||||
%+ sole-yo
|
||||
leaf+"(see https://github.com/urbit/arvo/issues/327 for details)"
|
||||
%+ sole-yo
|
||||
:- %leaf
|
||||
;: weld
|
||||
"WARNING: linking a moon to your "
|
||||
?-(ran $czar "galaxy", $king "star", $duke "planet")
|
||||
" can cause networking bugs"
|
||||
==
|
||||
%+ sole-lo
|
||||
[& %$ "enter y/yes to continue: "]
|
||||
|= inp/tape
|
||||
?. |(=("y" inp) =("yes" inp))
|
||||
(sole-so [%tang leaf+"canceled" ~])
|
||||
(sole-so [%tang leaf+"moon: {<`@p`mon>}; ticket: {<`@p`tic>}" leaf+"" ~])
|
||||
|
Loading…
Reference in New Issue
Block a user