fix: check for file presence after download
Test and release / Run Tests (push) Has been cancelled
Test and release / Build and Release (push) Has been cancelled

This commit is contained in:
Shy
2026-04-19 18:41:11 +02:00
parent c4b3f1fe3f
commit d771e6fc48
+10 -1
View File
@@ -1,4 +1,4 @@
use std::{error::Error, process::Command};
use std::{error::Error, fs, process::Command};
use shy_launcher::{config::Config, downloader};
@@ -10,6 +10,15 @@ async fn main() -> Result<(), Box<dyn Error>> {
println!("Starting download...");
downloader::download(config.downloads()).await;
println!("Verifying file presence...");
for download in config.downloads() {
let filename = download.filename();
if !fs::exists(filename)? {
panic!("Required file {} not present", filename);
}
println!("[ok] {}", filename);
}
println!("Freeing memory...");
if unsafe { libc::malloc_trim(0) } == 1 {
println!("Freed up some memory.");