소스 검색

fix: escape path space

GyDi 2 년 전
부모
커밋
fc5ca965ba
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src-tauri/src/core/manager.rs

+ 1 - 0
src-tauri/src/core/manager.rs

@@ -25,6 +25,7 @@ pub fn grant_permission(core: String) -> anyhow::Result<()> {
 
     #[cfg(target_os = "linux")]
     let output = {
+        let path = path.replace(' ', "\\ "); // 避免路径中有空格
         let shell = format!("setcap cap_net_bind_service,cap_net_admin=+ep {path}");
         Command::new("sudo")
             .arg("sh")