rerunInvocation function
The executable and arguments that rerun this CLI with args.
A native build reruns invokedExecutable, which follows the path to the
version installed now. Every other installation runs scriptPath on the
Dart VM.
Implementation
({String executable, List<String> args}) rerunInvocation(
List<String> args, {
required CliInstallation installation,
required String invokedExecutable,
required String resolvedExecutable,
required String scriptPath,
}) {
if (installation == CliInstallation.native) {
return (executable: invokedExecutable, args: args);
}
return (executable: resolvedExecutable, args: [scriptPath, ...args]);
}