fix: gravações fora da árvore do projeto, sidecar no externalBin
This commit is contained in:
1 parent
41ea729edc
commit
40120875c9
2 files changed
+25
-7
No files matched your search
@@ -77,14 +77,32 @@ impl ManagedAppState {
|
||||
}
|
||||
}
|
||||
|
||||
fn app_data_dir() -> PathBuf {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
std::env::var("LOCALAPPDATA")
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|_| std::env::temp_dir())
|
||||
.join("transcript")
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
std::env::var("HOME")
|
||||
.map(|home| PathBuf::from(home).join(".local").join("share").join("transcript"))
|
||||
.unwrap_or_else(|_| std::env::temp_dir().join("transcript"))
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
|
||||
{
|
||||
std::env::temp_dir().join("transcript")
|
||||
}
|
||||
}
|
||||
|
||||
fn default_model_dir() -> PathBuf {
|
||||
std::env::current_dir()
|
||||
.unwrap_or_else(|_| std::env::temp_dir())
|
||||
.join("models")
|
||||
app_data_dir().join("models")
|
||||
}
|
||||
|
||||
fn default_recordings_dir() -> PathBuf {
|
||||
std::env::current_dir()
|
||||
.unwrap_or_else(|_| std::env::temp_dir())
|
||||
.join("recordings")
|
||||
app_data_dir().join("recordings")
|
||||
}
|
||||
@@ -31,6 +31,6 @@
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": ["icons/icon.ico"],
|
||||
"externalBin": []
|
||||
"externalBin": ["binaries/sherpa-onnx-offline"]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user