From dd78670a4b7c8a425af76f622902642b4bca4e8e Mon Sep 17 00:00:00 2001
From: GyDi <segydi@foxmail.com>
Date: Tue, 11 Oct 2022 22:24:54 +0800
Subject: [PATCH] fix: clash meta not load geoip, close #212

---
 src-tauri/src/core/service.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src-tauri/src/core/service.rs b/src-tauri/src/core/service.rs
index 7b62a32..679c03d 100644
--- a/src-tauri/src/core/service.rs
+++ b/src-tauri/src/core/service.rs
@@ -129,8 +129,15 @@ impl Service {
     let app_dir = dirs::app_home_dir();
     let app_dir = app_dir.as_os_str().to_str().unwrap();
 
+    // fix #212
+    let args = match clash_core.as_str() {
+      "clash-meta" => vec!["-m", "-d", app_dir],
+      _ => vec!["-d", app_dir],
+    };
+
     let cmd = Command::new_sidecar(clash_core)?;
-    let (mut rx, cmd_child) = cmd.args(["-d", app_dir]).spawn()?;
+
+    let (mut rx, cmd_child) = cmd.args(args).spawn()?;
 
     // 将pid写入文件中
     let pid = cmd_child.pid();
-- 
GitLab