Skip to content

Commit

Permalink
v0.2.2 b2
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Jan 17, 2024
1 parent b22a44e commit 02ccc97
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions src-tauri/src/app/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ pub fn gui_main() {
}
}

info!("Successfully setup window");
Ok(())
})
.manage(AppState {
Expand Down
22 changes: 17 additions & 5 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use once_cell::sync::Lazy;
use anyhow::{Result, Context};
use directories::ProjectDirs;
use reqwest::Client;
use tracing::{debug, info};
use tracing::{debug, info, error};
use tracing_subscriber::layer::SubscriberExt;
use utils::ARCHITECTURE;

Expand Down Expand Up @@ -64,6 +64,19 @@ static HTTP_CLIENT: Lazy<Client> = Lazy::new(|| {
client
});

/// Creates a directory tree if it doesn't exist
macro_rules! mkdir {
($path:expr) => {
// Check if directory exists
if !$path.exists() {
// Create directory
if let Err(e) = fs::create_dir_all($path) {
error!("Failed to create directory {:?}: {}", $path, e);
}
}
};
}

pub fn main() -> Result<()> {
use tracing_subscriber::{fmt, EnvFilter};

Expand Down Expand Up @@ -93,12 +106,11 @@ pub fn main() -> Result<()> {
info!("Creating application directory");
debug!("Application directory: {:?}", LAUNCHER_DIRECTORY.data_dir());
debug!("Config directory: {:?}", LAUNCHER_DIRECTORY.config_dir());
fs::create_dir_all(LAUNCHER_DIRECTORY.data_dir())
.context("data_dir failed to create.")?;
fs::create_dir_all(LAUNCHER_DIRECTORY.config_dir())
.context("config_dir failed to create.")?;
mkdir!(LAUNCHER_DIRECTORY.data_dir());
mkdir!(LAUNCHER_DIRECTORY.config_dir());

// app
info!("Starting GUI");
app::gui::gui_main();

info!("Launcher exited");
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/minecraft/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use std::{collections::HashMap, fmt, marker::PhantomData, path::{Path, PathBuf}, str::FromStr};

use anyhow::{Result, Context};
use tracing::{debug, info, field::debug};
use tracing::{debug, info};
use tokio::fs;
use serde::{Deserialize, Deserializer, de::{self, MapAccess, Visitor}};
use void::Void;
Expand Down

0 comments on commit 02ccc97

Please sign in to comment.