From c9ab181d95dff9bf141bd6575e403d06b0d30368 Mon Sep 17 00:00:00 2001 From: microtau Date: Thu, 20 Jul 2023 10:42:48 +0000 Subject: [PATCH] REPBUILD: Always regenerate the image --- repbuild/src/main.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/repbuild/src/main.rs b/repbuild/src/main.rs index 31abb4c..55bcbeb 100644 --- a/repbuild/src/main.rs +++ b/repbuild/src/main.rs @@ -71,25 +71,11 @@ fn main() -> Result<(), Error> { } fn get_fs() -> Result, io::Error> { - let path = Path::new("target/disk.img"); - - match std::fs::metadata(path) { - Err(e) if e.kind() == io::ErrorKind::NotFound => (), - Err(e) => bail!(e), - Ok(_) => { - return FileSystem::new( - File::options().read(true).write(true).open(path)?, - FsOptions::new(), - ) - .into_report() - } - } - let mut img = File::options() .read(true) .write(true) .create(true) - .open(path)?; + .open(Path::new("target/disk.img"))?; img.set_len(1024 * 1024 * 64)?;