feat: add menu item

This commit is contained in:
lencx
2022-12-11 21:17:44 +08:00
parent 050b7010fc
commit 3eac43541e
9 changed files with 66 additions and 43 deletions

View File

@@ -4,18 +4,18 @@ use std::{
path::{Path, PathBuf},
process::Command,
};
use tauri::utils::config::Config;
// use tauri::utils::config::Config;
pub fn chat_root() -> PathBuf {
tauri::api::path::home_dir().unwrap().join(".chatgpt")
}
pub fn get_tauri_conf() -> Option<Config> {
let config_file = include_str!("../tauri.conf.json");
let config: Config =
serde_json::from_str(config_file).expect("failed to parse tauri.conf.json");
Some(config)
}
// pub fn get_tauri_conf() -> Option<Config> {
// let config_file = include_str!("../tauri.conf.json");
// let config: Config =
// serde_json::from_str(config_file).expect("failed to parse tauri.conf.json");
// Some(config)
// }
pub fn exists(path: &Path) -> bool {
Path::new(path).exists()