Skip to content

Commit

Permalink
Removes /logs from path when saving experiments + updated identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
dezoito committed Mar 14, 2024
1 parent 4c7d445 commit 18de794
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ pub async fn get_inference(
pub fn get_experiments(app_handle: tauri::AppHandle) -> Result<Vec<ExperimentFile>, Error> {
let binding = app_handle.path_resolver().app_data_dir().unwrap();
let app_data_dir = binding.to_str().unwrap();
let logs_dir = format!("{}/logs", app_data_dir);
let mut files: Vec<ExperimentFile> = fs::read_dir(logs_dir)?
let mut files: Vec<ExperimentFile> = fs::read_dir(app_data_dir)?
.filter_map(Result::ok)
.map(|entry| {
let path = entry.path();
Expand Down
8 changes: 3 additions & 5 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,11 @@ pub async fn log_experiment(
app_data_dir: &str,
) -> Result<(), Error> {
let experiment_uuid = &params.experiment_uuid;

let log_file_path = format!("{}/logs/{}.json", app_data_dir, experiment_uuid);
let log_file_path = format!("{}/{}.json", app_data_dir, experiment_uuid);

// Create the logs directory if it doesn't exist
let logs_dir = format!("{}/logs", app_data_dir);
if !Path::new(&logs_dir).exists() {
fs::create_dir(&logs_dir)?;
if !Path::new(&app_data_dir).exists() {
fs::create_dir(&app_data_dir)?;
}

let mut log_data = if Path::new(&log_file_path).exists() {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.dezoito.github.gridsearch",
"identifier": "com.github.dezoito.gridsearch",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
Expand Down

0 comments on commit 18de794

Please sign in to comment.