Skip to content

Commit 18f09fd

Browse files
authored
fix: don't git clean automatically (#885)
1 parent e4f3aed commit 18f09fd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/git_clean.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
# run without --dry-run
2-
system("git clean -xfd -e node_modules -e revdep")
1+
# Check files that should be cleaned (ignoring directories)
2+
needs_cleaned <- system("git clean -xf --dry-run")
3+
4+
if (length(needs_cleaned)) {
5+
stop(
6+
"There are untracked files in the repo. Please run",
7+
"`git clean -xf --dry-run` to see what will be removed. ",
8+
"Add --force to force removal of untracked files."
9+
)
10+
}

0 commit comments

Comments
 (0)