added nodecolor and nodename to lightning config prompts

This commit is contained in:
jash
2018-10-08 18:11:23 +02:00
committed by kexkey
parent b314ee5b05
commit 6f31f18e53
2 changed files with 31 additions and 2 deletions

View File

@@ -104,7 +104,6 @@ module.exports = class extends Generator {
}
_pathValidator( p ) {
return true;
}
@@ -112,6 +111,20 @@ module.exports = class extends Generator {
return true;
}
_colorValidator(color) {
if( !validator.isHexColor(color) ) {
throw new Error('Not a hex color.');
}
return true;
}
_notEmptyValidator( path ) {
if( !path ) {
throw new Error('Please enter something');
}
return true;
}
_trimFilter( input ) {
return (input+"").trim();
}

View File

@@ -50,7 +50,23 @@ module.exports = {
name: 'lightning_external_ip',
default: utils._getDefault( 'lightning_external_ip' ),
validate: utils._ipOrFQDNValidator,
message: 'What external ip does your lightning node have?'+'\n',
message: prefix()+'What external ip does your lightning node have?'+'\n',
},
{
when: featureCondition,
type: 'input',
name: 'lightning_nodename',
default: utils._getDefault( 'lightning_nodename' ),
validate: utils._notEmptyValidator,
message: prefix()+'What name has your lightning node?'+'\n',
},
{
when: featureCondition,
type: 'input',
name: 'lightning_nodecolor',
default: utils._getDefault( 'lightning_nodecolor' ),
validate: utils._colorValidator,
message: prefix()+'What color has your lightning node?'+'\n',
}];
},
templates: function( props ) {