Skip to content

Commit

Permalink
fix create_template on minimal template
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Nov 16, 2024
1 parent e0a7512 commit 31fa7a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ fn create_template(template: CreateTemplate) {
for file in &["README.md", "CMakeLists.txt"] {
let file = template.project_location.join(file);

let contents = fs::read_to_string(&file)
.unwrap()
.replace("Template", &filtered_name);
let Ok(contents) = fs::read_to_string(&file) else {
continue;
};
let contents = contents.replace("Template", &filtered_name);
fs::write(file, contents).unwrap();
}

Expand Down

0 comments on commit 31fa7a4

Please sign in to comment.