helpme: check for plugins via rpc listconfigs

This commit is contained in:
Michael Schmoock
2020-12-15 10:13:18 +01:00
parent 5c81ab5a4f
commit 7cd3ebae61

View File

@@ -510,15 +510,17 @@ node! Be prepared to lose your funds (but please report a bug if you do!)
read_config(configfile_global, config) read_config(configfile_global, config)
read_config(configfile_network, config) read_config(configfile_network, config)
plugins = plugin.rpc.listconfigs()['plugins']
if len(config) == 0: if len(config) == 0:
r += "No config file. Try 'helpme bling'" r += "No config file. Try 'helpme bling'"
elif 'alias' not in config and 'rgb' not in config: elif 'alias' not in config and 'rgb' not in config:
r += "You have not customized alias or color. Try 'helpme bling'" r += "You have not customized alias or color. Try 'helpme bling'"
# They pretty much need this plugin and the pay plugin. # They pretty much need this plugin. pay, bcli, ... are in 'important-plugins'
elif len(config['plugin']) <= 2: elif len(plugins) <= 1:
r += "You have not added plugins. Try 'helpme plugins'" r += "You have not added plugins. Try 'helpme plugins'"
else: else:
r += "COMPLETE ({} plugins)".format(len(config['plugin'])) r += "COMPLETE ({} plugins)".format(len(plugins))
stages['plugins'] = True stages['plugins'] = True
if all(v for v in stages.values()): if all(v for v in stages.values()):