fix: create cache folder if it doesn't exist

This commit is contained in:
Nikita Podvirnyi 2024-08-16 14:33:05 +02:00
parent 85ba5b0d08
commit df378357ad
No known key found for this signature in database
GPG key ID: 859D416E5142AFF3

View file

@ -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
@ -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;