Skip to content

Commit

Permalink
Fixing OS error 3 on startup (#4)
Browse files Browse the repository at this point in the history
Fixing #3
  • Loading branch information
clarkmcc authored Jul 23, 2023
1 parent b71f214 commit 9304ca9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chitchat"
version = "0.1.0"
version = "0.1.1"
description = "Chitchat"
authors = ["Clark McCauley"]
license = "MIT"
Expand Down
11 changes: 8 additions & 3 deletions src-tauri/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::path::PathBuf;
use anyhow::Result;
use home::home_dir;
use std::fs::create_dir_all;
use std::path::PathBuf;

pub fn get_app_dir() -> Result<PathBuf> {
Ok(home_dir()
Expand All @@ -9,9 +10,13 @@ pub fn get_app_dir() -> Result<PathBuf> {
}

pub fn get_models_dir() -> Result<PathBuf> {
Ok(get_app_dir()?.join("models"))
let dir = get_app_dir()?.join("models");
create_dir_all(&dir)?;
Ok(dir)
}

pub fn get_logs_dir() -> Result<PathBuf> {
Ok(get_app_dir()?.join("logs"))
let dir = get_app_dir()?.join("logs");
create_dir_all(&dir)?;
Ok(dir)
}

0 comments on commit 9304ca9

Please sign in to comment.