Skip to content

Commit

Permalink
fix: create cache folder if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
krypt0nn committed Aug 16, 2024
1 parent 85ba5b0 commit df37835
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ fn main() -> anyhow::Result<()> {
// Setup custom panic handler
human_panic::setup_panic!(human_panic::metadata!());

// Create launcher folder if it isn't
// Create launcher folder if it doesn't exist.
if !LAUNCHER_FOLDER.exists() {
std::fs::create_dir_all(LAUNCHER_FOLDER.as_path()).expect("Failed to create launcher folder");

// This one is kinda critical buy well, I can't do something with it
// This one is kinda critical but well, I can't do anything about it
std::fs::write(FIRST_RUN_FILE.as_path(), "").expect("Failed to create .first-run file");

// Set initial launcher language based on system language
Expand All @@ -125,6 +125,12 @@ fn main() -> anyhow::Result<()> {
Config::update_raw(config).expect("Failed to update config");
}

// Create cache folder if it doesn't exist.
if !CACHE_FOLDER.exists() {
std::fs::create_dir_all(CACHE_FOLDER.as_path())
.expect("Failed to create cache folder");
}

// Force debug output
let mut force_debug = false;

Expand Down

0 comments on commit df37835

Please sign in to comment.