mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 11:42:21 +08:00
chore: replace sudo with pkexec execution
This commit is contained in:
parent
90091db3b1
commit
babf5d840c
|
@ -103,7 +103,6 @@ pub async fn reinstall_service() -> Result<()> {
|
|||
};
|
||||
log::info!(target:"app", "status code:{}", status.code().unwrap());
|
||||
|
||||
let elevator = crate::utils::help::linux_elevator();
|
||||
let status = match get_effective_uid() {
|
||||
0 => StdCommand::new(install_shell).status()?,
|
||||
_ => StdCommand::new(elevator)
|
||||
|
|
|
@ -108,7 +108,7 @@ pub fn open_file(app: tauri::AppHandle, path: PathBuf) -> Result<()> {
|
|||
#[cfg(target_os = "linux")]
|
||||
pub fn linux_elevator() -> String {
|
||||
use std::process::Command;
|
||||
match Command::new("which").arg("sudo").output() {
|
||||
match Command::new("which").arg("pkexec").output() {
|
||||
Ok(output) => {
|
||||
if !output.stdout.is_empty() {
|
||||
// Convert the output to a string slice
|
||||
|
|
Loading…
Reference in New Issue
Block a user