executeCommand static method

Future<void> executeCommand(
  1. List<String> commands, {
  2. int concurrent = defaultConcurrent,
  3. void stdout(
    1. String line
    )?,
  4. void stdoutErr(
    1. String line
    )?,
  5. bool ignorePubWorkspaces = false,
})

Executes commands concurrently in the current directory.

This method executes the specified commands concurrently in the current directory, handling results and errors appropriately.

Parameters:

  • commands: List of commands to execute
  • concurrent: Number of concurrent executions (default: 6)
  • stdout: Callback for stdout lines
  • stdoutErr: Callback for stderr lines
  • ignorePubWorkspaces: Whether to ignore pub workspaces (default: false)

Example:

// Run multiple Flutter commands concurrently
await ModularHelper.executeCommand(['flutter pub get', 'flutter analyze']);

Implementation

static Future<void> executeCommand(
  List<String> commands, {
  int concurrent = defaultConcurrent,
  void Function(String line)? stdout,
  void Function(String line)? stdoutErr,
  bool ignorePubWorkspaces = false,
}) async {
  await _executeCommandFutures(
    commands,
    concurrent: concurrent,
    stdout: stdout,
    stdoutErr: stdoutErr,
  );
}