From d06082fc7aad8412aba536c4102582ee84458fd8 Mon Sep 17 00:00:00 2001 From: lubeilin <1791778603@qq.com> Date: Sat, 6 Jan 2024 11:26:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=BE=93=E5=87=BA=E5=88=B0?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnt-cli/Cargo.toml | 1 - vnt-cli/src/main.rs | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vnt-cli/Cargo.toml b/vnt-cli/Cargo.toml index 22f9b52..4dbba10 100644 --- a/vnt-cli/Cargo.toml +++ b/vnt-cli/Cargo.toml @@ -12,7 +12,6 @@ tokio = { version = "1.32.0", features = ["full"] } getopts = "0.2.21" console = "0.15.2" os_info = "3.7.0" -dirs = "5.0.1" serde = "1.0" serde_json = "1.0.94" serde_yaml = "0.8.26" diff --git a/vnt-cli/src/main.rs b/vnt-cli/src/main.rs index f460bce..d348cdc 100644 --- a/vnt-cli/src/main.rs +++ b/vnt-cli/src/main.rs @@ -21,9 +21,11 @@ mod console_out; mod root_check; pub fn app_home() -> io::Result { - let path = dirs::home_dir() - .ok_or(io::Error::new(io::ErrorKind::Other, "not home"))? - .join(".vnt-cli"); + let path = std::env::current_exe() + .expect("current_exe error") + .parent() + .expect("current_exe parent error") + .join("env"); if !path.exists() { std::fs::create_dir_all(&path)?; }