@@ -56,6 +56,7 @@ export interface InitServiceParams {
5656
5757export class InitService {
5858 constructor ( private readonly logger : Logger , private readonly workingDir : string , private readonly params : InitServiceParams ) { }
59+
5960 async execute ( ) : Promise < void > {
6061 const networkInputFile = NetworkUtils . NETWORK_INPUT_FILE ;
6162 const customNetworkPresetFile = NetworkUtils . NETWORK_PRESET_FILE ;
@@ -391,10 +392,13 @@ export class InitService {
391392 const nickName = await this . promptName ( `Nodes's Nick Name` , 'The nick name of the these nodes' , metadata . nickName ) ;
392393
393394 const restProtocol = metadata . api ? await this . promptRestProtocol ( ) : undefined ;
395+
394396 const { confirmCreate } = await prompt ( [
395397 {
396398 default : true ,
397- message : `Do you want to create ${ total } nodes of type ${ nodeTypeName } each with balance of ${ balances . join ( ', ' ) } ?` ,
399+ message : balances . find ( ( b ) => b > 0 )
400+ ? `Do you want to create ${ total } nodes of type ${ nodeTypeName } each with balance of ${ balances . join ( ', ' ) } ?`
401+ : `Do you want to create ${ total } nodes of type ${ nodeTypeName } ?` ,
398402 type : 'confirm' ,
399403 name : 'confirmCreate' ,
400404 } ,
@@ -512,6 +516,7 @@ export class InitService {
512516 public async generateRandomKey ( fieldName : string , message : string , networkType : NetworkType ) : Promise < string > {
513517 return this . promptText ( fieldName , message , Account . generateNewAccount ( networkType ) . privateKey , CommandUtils . isValidPrivateKey ) ;
514518 }
519+
515520 public async promptName ( fieldName : string , message : string , defaultValue : string | undefined ) : Promise < string > {
516521 return this . promptText ( fieldName , message , defaultValue , this . isValidName ) ;
517522 }
@@ -563,7 +568,6 @@ export class InitService {
563568 fieldName : string ,
564569 message : string ,
565570 defaultValue : string | undefined ,
566-
567571 validate ?: ( input : any ) => boolean | string | Promise < boolean | string > ,
568572 ) : Promise < string > {
569573 return this . confirmedPrompt (
0 commit comments