runProcessAndEnsureExit function

Future<int> runProcessAndEnsureExit(
  1. ProcessDeclaration processDeclaration, {
  2. Logger? log,
})

Implementation

Future<int> runProcessAndEnsureExit(ProcessDeclaration processDeclaration,
    {Logger? log}) async {
  final process = await Process.start(
      processDeclaration.executable, processDeclaration.args,
      mode: processDeclaration.mode ?? ProcessStartMode.normal,
      workingDirectory: processDeclaration.workingDirectory);
  ensureProcessExit(process, log: log);
  return process.exitCode;
}