fix: 目录和 pipe 名统一改为 wx-cli(原 wechat-cli)

This commit is contained in:
jackwener
2026-04-16 15:49:35 +08:00
parent 6e599dbe33
commit 3e7b4ed8ee
4 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ pub fn is_alive() -> bool {
#[cfg(windows)]
{
// 通过 named pipe 检测
let pipe_path = r"\\.\pipe\wechat-cli-daemon";
let pipe_path = r"\\.\pipe\wx-cli-daemon";
use std::fs::OpenOptions;
OpenOptions::new().read(true).write(true).open(pipe_path).is_ok()
}
@@ -151,7 +151,7 @@ fn send_windows(req: Request) -> Result<Response> {
use std::fs::OpenOptions;
use std::os::windows::fs::OpenOptionsExt;
let pipe_path = r"\\.\pipe\wechat-cli-daemon";
let pipe_path = r"\\.\pipe\wx-cli-daemon";
let mut pipe = OpenOptions::new()
.read(true)
.write(true)
+4 -4
View File
@@ -11,7 +11,7 @@ pub struct Config {
pub wechat_process: String,
}
/// 从 <exe_dir>/config.json 或 $HOME/.wechat-cli/config.json 加载配置
/// 从 <exe_dir>/config.json 或 $HOME/.wx-cli/config.json 加载配置
pub fn load_config() -> Result<Config> {
let config_path = find_config_file()?;
let content = std::fs::read_to_string(&config_path)
@@ -85,9 +85,9 @@ fn find_config_file() -> Result<PathBuf> {
if cwd.exists() {
return Ok(cwd);
}
// 3. ~/.wechat-cli/config.json
// 3. ~/.wx-cli/config.json
if let Some(home) = dirs::home_dir() {
let p = home.join(".wechat-cli").join("config.json");
let p = home.join(".wx-cli").join("config.json");
if p.exists() {
return Ok(p);
}
@@ -104,7 +104,7 @@ fn find_config_file() -> Result<PathBuf> {
pub fn cli_dir() -> PathBuf {
dirs::home_dir()
.unwrap_or_else(|| PathBuf::from("/tmp"))
.join(".wechat-cli")
.join(".wx-cli")
}
pub fn sock_path() -> PathBuf {
+1 -1
View File
@@ -132,7 +132,7 @@ async fn serve_windows(
tokio::prelude::*, GenericNamespaced, ListenerOptions,
};
let pipe_name = r"\\.\pipe\wechat-cli-daemon";
let pipe_name = r"\\.\pipe\wx-cli-daemon";
let name = pipe_name.to_ns_name::<GenericNamespaced>()?;
let opts = ListenerOptions::new().name(name);
let listener = opts.create_tokio()?;