Skip to content

Commit

Permalink
download_sysext: skip checking for downloads if that does not exist
Browse files Browse the repository at this point in the history
We need to skip checking for existing downloads, if the file does not
exist. Otherwise, check_download will simply fail in the beginning,
due to missing files.
  • Loading branch information
dongsupark committed Nov 9, 2023
1 parent af37791 commit 3d8ef7a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bin/download_sysext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ impl<'a> Package<'a> {
#[rustfmt::skip]
fn check_download(&mut self, in_dir: &Path) -> Result<(), Box<dyn Error>> {
let path = in_dir.join(&*self.name);

if !path.exists() {
// skip checking for existing downloads
info!("{} does not exist, skipping existing downloads.", path.display());
return Ok(());
}

let md = fs::metadata(&path)?;

let size_on_disk = md.len() as usize;
Expand Down

0 comments on commit 3d8ef7a

Please sign in to comment.