Skip to content

Commit

Permalink
fix: don't git clean automatically (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Oct 23, 2023
1 parent e4f3aed commit 18f09fd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/git_clean.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# run without --dry-run
system("git clean -xfd -e node_modules -e revdep")
# Check files that should be cleaned (ignoring directories)
needs_cleaned <- system("git clean -xf --dry-run")

if (length(needs_cleaned)) {
stop(
"There are untracked files in the repo. Please run",
"`git clean -xf --dry-run` to see what will be removed. ",
"Add --force to force removal of untracked files."
)
}

0 comments on commit 18f09fd

Please sign in to comment.