Skip to content

Commit 6b13361

Browse files
committed
don't add module defs more than once
1 parent d645618 commit 6b13361

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

blueprint/cli/src/bin/generate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ fn append_module_definition_to_project_file(path: &str, module_name: &str, is_pu
433433
fs::read_to_string(path).context(format!(r#"Could not read file "{}"!"#, path))?;
434434
let file_contents = file_contents.trim();
435435

436+
if file_contents.contains(&module_def) {
437+
return Ok(());
438+
}
439+
436440
let mut options = OpenOptions::new();
437441
options.write(true);
438442

0 commit comments

Comments
 (0)