默认输出到当前路径

This commit is contained in:
lubeilin
2024-01-06 11:26:09 +08:00
parent 77a78daac1
commit d06082fc7a
2 changed files with 5 additions and 4 deletions
-1
View File
@@ -12,7 +12,6 @@ tokio = { version = "1.32.0", features = ["full"] }
getopts = "0.2.21" getopts = "0.2.21"
console = "0.15.2" console = "0.15.2"
os_info = "3.7.0" os_info = "3.7.0"
dirs = "5.0.1"
serde = "1.0" serde = "1.0"
serde_json = "1.0.94" serde_json = "1.0.94"
serde_yaml = "0.8.26" serde_yaml = "0.8.26"
+5 -3
View File
@@ -21,9 +21,11 @@ mod console_out;
mod root_check; mod root_check;
pub fn app_home() -> io::Result<PathBuf> { pub fn app_home() -> io::Result<PathBuf> {
let path = dirs::home_dir() let path = std::env::current_exe()
.ok_or(io::Error::new(io::ErrorKind::Other, "not home"))? .expect("current_exe error")
.join(".vnt-cli"); .parent()
.expect("current_exe parent error")
.join("env");
if !path.exists() { if !path.exists() {
std::fs::create_dir_all(&path)?; std::fs::create_dir_all(&path)?;
} }