run method

Future<List<int>> run()

Implementation

Future<List<int>> run() async {
  final result = await Process.run(
    'sh',
    ['-c', _script, '--', ...args, '-o-'],
    stdoutEncoding: null,
    stderrEncoding: null,
    environment: {
      'SERVER_VERSION': overrideGeneratorVersion ?? supportedVersion
    },
  );

  if (result.exitCode != 0) {
    throw ContractsGeneratorException(
      'Generator script failed with: ${String.fromCharCodes(result.stderr as List<int>)}',
    );
  }

  return result.stdout as List<int>;
}