reckless: add json output option

Also redirect config creation prompts to stderr in order to not interfere
with json output on stdout.

Changelog-Added: reckless provides json output with option flag -j/--json
This commit is contained in:
Alex Myers
2024-07-02 07:50:50 -05:00
committed by Rusty Russell
parent 75d8d8b91f
commit a2e458047f
2 changed files with 77 additions and 45 deletions

View File

@@ -111,7 +111,8 @@ def get_reckless_node(node_factory):
def check_stderr(stderr):
def output_okay(out):
for warning in ['[notice]', 'WARNING:', 'npm WARN',
'npm notice', 'DEPRECATION:', 'Creating virtualenv']:
'npm notice', 'DEPRECATION:', 'Creating virtualenv',
'config file not found:', 'press [Y]']:
if out.startswith(warning):
return True
return False