diff --git a/src/main.rs b/src/main.rs index 2ae911c..6a08a6a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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> { 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.");