mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
big_psb: remove a failed fixture only in the fresh default folder
This commit is contained in:
1 parent
cb71932ef9
commit
c0faf43bea
1 file changed
+5
-1
@@ -42,8 +42,12 @@ fn main() -> std::io::Result<()> {
|
||||
for case in PSB_CASES.iter().chain([&PSD_2GB]).filter(|c| wanted.is_empty() || wanted.iter().any(|w| w == c.name)) {
|
||||
let path = out.join(case.file_name());
|
||||
let t = std::time::Instant::now();
|
||||
// In the fresh default folder only: a half-written fixture is removed, but never a file an
|
||||
// operator-chosen folder already held.
|
||||
let len = case.write_file(&path).inspect_err(|_| {
|
||||
let _ = std::fs::remove_file(&path); // no half-written fixture left behind
|
||||
if args.is_empty() {
|
||||
let _ = std::fs::remove_file(&path);
|
||||
}
|
||||
})?;
|
||||
println!("{}: {:.2} GB in {:.1} s", path.display(), len as f64 / 1e9, t.elapsed().as_secs_f64());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user