Skip to content

Update the Process.run command #140

@vanlooverenkoen

Description

@vanlooverenkoen

When executing build_runner we need to wait for a long time without knowing if it worked or not. We should switch the Process.run to this functions:

Future<void> _runProcess(String command, List<String> args) async {
  print('\n  $command ${args.join(' ')}\n');
  final completer = Completer<void>();
  final result = await Process.start(
    command,
    args,
    mode: ProcessStartMode.detachedWithStdio,
  );
  print('======================================================================');
  final subscription = result.stdout.listen((codeUnits) => stdout.write(utf8.decode(codeUnits)));
  subscription.onDone(() {
    print('======================================================================');
    completer.complete();
  });
  subscription.onError((dynamic error) => completer.completeError('Failed to complete process run: $error'));
  return completer.future;
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions