Skip to content

Commit

Permalink
initialize engines.json
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Feb 11, 2024
1 parent 929dc1b commit f060989
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const REQUIRED_DIRS: &[(BaseDirectory, &str)] = &[
(BaseDirectory::Document, "EnCroissant"),
];

const REQUIRED_FILES: &[(BaseDirectory, &str)] =
&[(BaseDirectory::AppData, "engines/engines.json")];
const REQUIRED_FILES: &[(BaseDirectory, &str, &str)] =
&[(BaseDirectory::AppData, "engines/engines.json", "[]")];

#[tauri::command]
#[specta::specta]
Expand Down Expand Up @@ -198,7 +198,7 @@ fn main() {
}

log::info!("Checking for required files");
for (dir, path) in REQUIRED_FILES.iter() {
for (dir, path, contents) in REQUIRED_FILES.iter() {
let path = resolve_path(
&app.config(),
app.package_info(),
Expand All @@ -209,7 +209,7 @@ fn main() {
.unwrap();
if !Path::new(&path).exists() {
log::info!("Creating file {}", path.to_string_lossy());
std::fs::write(&path, "").unwrap();
std::fs::write(&path, contents).unwrap();
}
}

Expand Down

0 comments on commit f060989

Please sign in to comment.