askToRunShell method

PluginInstaller askToRunShell({
  1. required String prompt,
  2. required String command,
  3. List<String> args = const <String>[],
})

HYBRID: prompts immediately. When the user confirms, enqueues a RunShell that the dispatcher will execute during commit.

@param prompt Confirmation question. @param command Executable to run on yes. @param args Positional arguments. @return This installer (chainable).

Implementation

PluginInstaller askToRunShell({
  required String prompt,
  required String command,
  List<String> args = const <String>[],
}) {
  if (_ctx.prompt.confirm(prompt)) {
    _ops.add(RunShell(command: command, args: args));
  }
  return this;
}