Add sudo_command option (#379)

This allows the user to specify the preferred sudo command to be used
instead of the command chosen by Sudo::detect
This commit is contained in:
Thomas de Queiroz Barros
2023-03-13 19:23:37 +00:00
committed by GitHub
parent 462016e51e
commit a3628d0d49
4 changed files with 21 additions and 3 deletions

View File

@@ -107,7 +107,7 @@ For more information about this issue see https://askubuntu.com/questions/110969
let git = git::Git::new();
let mut git_repos = git::Repositories::new(&git);
let sudo = sudo::Sudo::detect();
let sudo = config.sudo_command().map_or_else(sudo::Sudo::detect, sudo::Sudo::new);
let run_type = executor::RunType::new(config.dry_run());
let ctx = execution_context::ExecutionContext::new(run_type, sudo, &git, &config, &base_dirs);