Skip to content

Commit

Permalink
create more hff directories to avoid not moving them
Browse files Browse the repository at this point in the history
if the moves failed and just printed a warning, the pts directory could stay
around and cause problems for future runs
  • Loading branch information
ntBre committed Aug 2, 2024
1 parent 8f30ec9 commit 2285995
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/coord_type/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,14 @@ impl Normal {
/// to dir/hff/{opt,pts,freqs}
fn cleanup(dir: impl AsRef<Path>) {
let dir = dir.as_ref();
let hff = dir.join("hff");
let mut hff = dir.join("hff");

let mut i = 0;
while hff.exists() {
log::trace!("hff dir found, incrementing counter");
hff = dir.join(format!("hff{i}"));
i += 1;
}

if let Err(e) = std::fs::create_dir_all(&hff) {
log::warn!("failed to create {hff:?} with {e}");
Expand Down

0 comments on commit 2285995

Please sign in to comment.