Skip to content

Commit 912edba

Browse files
authored
Remove snap directory if it is empty (#1535)
* Remove snapshot folder if it is empty * Use new `is_dir_empty()` method
1 parent f32cd62 commit 912edba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/snapshot-cleanup.R

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ snapshot_cleanup <- function(path, test_files_seen = character(), snap_files_see
1212
empty <- dirs[map_lgl(dirs, is_dir_empty)]
1313
unlink(empty, recursive = TRUE)
1414

15+
# Delete snapshot folder
16+
if (is_dir_empty(path)) {
17+
unlink(path, recursive = TRUE)
18+
}
19+
1520
rstudio_tickle()
1621

1722
invisible(outdated)

0 commit comments

Comments
 (0)