fix: output and remove pkgfile

This commit is contained in:
iff 2024-12-07 23:43:51 +01:00
parent 7e84862558
commit 5c919ad940
3 changed files with 28 additions and 18 deletions

View file

@ -167,6 +167,15 @@ pub fn split_command(command: &str) -> Vec<String> {
split_command
}
pub fn elevate(data: &mut Data, command: &mut String) {
for privilege in PRIVILEGE_LIST.iter() {
if data.has_executable(privilege) {
*command = format!("{} {}", privilege, command);
break;
}
}
}
pub fn get_error(shell: &str, command: &str) -> String {
let error_msg = std::env::var("_PR_ERROR_MSG");
let error = if let Ok(error_msg) = error_msg {