Skip to content

Commit

Permalink
chore: fix test project initialization (#7418)
Browse files Browse the repository at this point in the history
fix initialization
  • Loading branch information
klkvr authored Mar 18, 2024
1 parent 42a9d34 commit f686391
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/test-utils/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ pub fn initialize(target: &Path) {
write.read_to_string(&mut data).unwrap();

if data != "1" {
write.set_len(0).unwrap();
write.seek(std::io::SeekFrom::Start(0)).unwrap();
write.write_all(b"1").unwrap();

// Initialize and build.
let (prj, mut cmd) = setup_forge("template", foundry_compilers::PathStyle::Dapptools);
eprintln!("- initializing template dir in {}", prj.root().display());
Expand All @@ -259,6 +255,11 @@ pub fn initialize(target: &Path) {

// Copy the template to the global template path.
pretty_err(tpath, copy_dir(prj.root(), tpath));

// Update lockfile to mark that template is initialized.
write.set_len(0).unwrap();
write.seek(std::io::SeekFrom::Start(0)).unwrap();
write.write_all(b"1").unwrap();
}

// Release the write lock and acquire a new read lock.
Expand Down

0 comments on commit f686391

Please sign in to comment.