Skip to content

Commit

Permalink
Avoid deleting .git in subdoc generate
Browse files Browse the repository at this point in the history
  • Loading branch information
danakj committed Dec 23, 2023
1 parent 33e7c28 commit dc57ecc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subdoc/lib/gen/generate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ sus::result::Result<void, GenerateError> delete_tree(
for (auto it = std::filesystem::directory_iterator(path);
it != std::filesystem::directory_iterator(); ++it) {
auto name = it->path().filename().string();
if (name == "." || name == "..") continue;
// Don't delete `.git` or `.` and `..`.
if (name.starts_with(".")) continue;

if (it->is_directory()) {
auto result = delete_tree(it->path());
Expand Down

0 comments on commit dc57ecc

Please sign in to comment.