File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
packages/cli/src/commands Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -432,7 +432,7 @@ async function processInitForm(
432
432
if ( remaining == 0 ) return shown ;
433
433
if ( shown . length === choices . length ) {
434
434
shown . push ( {
435
- name : '--other-- ' ,
435
+ name : 'N/A ' ,
436
436
value : '' ,
437
437
hint : '· other network not on the list' ,
438
438
message : `Other` ,
@@ -485,15 +485,21 @@ async function processInitForm(
485
485
. map ( networkToChoice )
486
486
. filter ( ( { value } ) => ( value ?? '' ) . includes ( input . toLowerCase ( ) ) ) ,
487
487
) ,
488
- validate : value => {
489
- if ( value === '--other--' ) {
490
- return 'To add a network refer to https://github.com/graphprotocol/networks-registry' ;
491
- }
492
- return networks . find ( n => n . id === value ) ? true : 'Pick a network' ;
493
- } ,
488
+ validate : value =>
489
+ value === 'N/A' || networks . find ( n => n . id === value ) ? true : 'Pick a network' ,
494
490
result : value => {
495
491
initDebugger . extend ( 'processInitForm' ) ( 'networkId: %O' , value ) ;
496
- network = networks . find ( n => n . id === value ) ! ;
492
+ const foundNetwork = networks . find ( n => n . id === value ) ;
493
+ if ( ! foundNetwork ) {
494
+ this . log ( `
495
+ The chain list is populated from the Networks Registry:
496
+
497
+ https://github.com/graphprotocol/networks-registry
498
+
499
+ To add a chain to the registry you can create an issue or submit a PR` ) ;
500
+ process . exit ( 0 ) ;
501
+ }
502
+ network = foundNetwork ;
497
503
promptManager . setOptions ( 'protocol' , {
498
504
choices : [
499
505
{
You can’t perform that action at this time.
0 commit comments