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(
432432 if ( remaining == 0 ) return shown ;
433433 if ( shown . length === choices . length ) {
434434 shown . push ( {
435- name : '--other-- ' ,
435+ name : 'N/A ' ,
436436 value : '' ,
437437 hint : '· other network not on the list' ,
438438 message : `Other` ,
@@ -485,15 +485,21 @@ async function processInitForm(
485485 . map ( networkToChoice )
486486 . filter ( ( { value } ) => ( value ?? '' ) . includes ( input . toLowerCase ( ) ) ) ,
487487 ) ,
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 => ( value === 'N/A' || networks . find ( n => n . id === value ) ) ? true : 'Pick a network' ,
494489 result : value => {
495490 initDebugger . extend ( 'processInitForm' ) ( 'networkId: %O' , value ) ;
496- network = networks . find ( n => n . id === value ) ! ;
491+ const foundNetwork = networks . find ( n => n . id === value ) ;
492+ if ( ! foundNetwork ) {
493+ this . log ( `
494+ The chain list is populated from the Networks Registry:
495+
496+ https://github.com/graphprotocol/networks-registry
497+
498+ To add a chain to the registry you can create an issue or submit a PR`
499+ ) ;
500+ process . exit ( 0 ) ;
501+ }
502+ network = foundNetwork ;
497503 promptManager . setOptions ( 'protocol' , {
498504 choices : [
499505 {
You can’t perform that action at this time.
0 commit comments