ensureInstalled function
Implementation
Future<void> ensureInstalled(
String processName, {
List<String>? installCommands,
}) async {
if (!await isInstalled(processName)) {
await _updateDefaultPackageManager();
installCommands ??= _defaultInstallCommands;
installCommands.add(processName);
final executable = installCommands.first;
await runProcess(
printCall: true,
executable,
installCommands.length > 1 ? installCommands.sublist(1) : [],
runInShell: true,
);
}
}