We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b68e1b commit 16f1b82Copy full SHA for 16f1b82
src-tauri/src/main.rs
@@ -7,15 +7,21 @@ use hf_hub::api::sync::Api;
7
8
#[tauri::command]
9
fn open() -> Result<(), String> {
10
- let dir = env::current_dir().map_err(|e| e.to_string())?;
11
- open::that(dir.join("models")).ok();
+ let dir = env::current_exe().map_err(|e| e.to_string())?;
+ open::that(dir.parent().unwrap().join("models")).ok();
12
Ok(())
13
}
14
15
16
fn path() -> Result<String, String> {
17
- env::current_dir()
18
- .map(|p| p.to_string_lossy().to_string())
+ env::current_exe()
+ .map(|p| {
19
+ p.parent()
20
+ .unwrap()
21
+ .join("models")
22
+ .to_string_lossy()
23
+ .to_string()
24
+ })
25
.map_err(|e| e.to_string())
26
27
0 commit comments