Skip to content

Commit 899eb38

Browse files
committed
fix: remove git directory after cloning
1 parent 60f314f commit 899eb38

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/create.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@ pub fn create(project_path: Option<PathBuf>, template_id: Option<String>) -> eyr
7070
}
7171
};
7272

73-
Repository::clone(template.repository, &target_path)?;
73+
let repo = Repository::clone(template.repository, &target_path)?;
74+
let git_dir = repo.path().to_path_buf();
75+
drop(repo);
76+
77+
// Remove the git directory
78+
if git_dir.exists() {
79+
std::fs::remove_dir_all(git_dir)?;
80+
}
7481

7582
if ["example-js", "example-ts"].contains(&template.id) {
7683
println!("\nProject created. Now run:\n");

0 commit comments

Comments
 (0)