Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use raw text as command result #911

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions lib/routes/dev/command_line_interface.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:convert';
import 'dart:io';

import 'package:c_breez/routes/dev/widget/command_list.dart';
Expand Down Expand Up @@ -158,8 +157,6 @@ class _CommandLineInterfaceState extends State<CommandLineInterface> {
_lastCommand = command;
isLoading = true;
});
// TODO: Style the response output from SDK
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
try {
var commandArgs = command.split(RegExp(r"\s"));
if (commandArgs.isEmpty) {
Expand All @@ -182,9 +179,7 @@ class _CommandLineInterfaceState extends State<CommandLineInterface> {
case 'stop':
final command = commandArgs[0].toLowerCase();
_log.info("executing command: $command");
final answer = await _breezSDK.executeCommand(command: command);
_log.info("Received answer: $answer");
reply = encoder.convert(answer);
reply = await _breezSDK.executeCommand(command: command);
_log.info("Reply: $reply");
break;
default:
Expand Down
Loading