spawnDartProcess function

Future<Process> spawnDartProcess(
  1. List<String> args, {
  2. Map<String, String>? environment,
  3. String? workingDirectory,
  4. bool inheritStdio = true,
})

Spawns a Dart process using the current Dart executable.

By default, stdio is inherited to make the child process feel "attached".

Implementation

Future<Process> spawnDartProcess(
  List<String> args, {
  Map<String, String>? environment,
  String? workingDirectory,
  bool inheritStdio = true,
}) async {
  final process = await startDartProcess(
    args,
    workingDirectory: workingDirectory,
    environment: environment,
    mode: inheritStdio
        ? ProcessStartMode.inheritStdio
        : ProcessStartMode.normal,
  );
  return process;
}