We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a29261d commit 167580aCopy full SHA for 167580a
prune-gh-pages.sh
@@ -43,7 +43,16 @@ done
43
branches=$(echo "${branches[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')
44
45
# Remove all directories that don't have corresponding branches
46
-find . -type d \( -path ./.git $(printf " -o -path ./%s" $branches) \) -prune -o -type d -mindepth 1 -exec rm -rfv {} \;
+# It would be nice if we could exclude everything in .gitignore, but we're
47
+# not on the branch with the .gitignore anymore... so we can't.
48
+find . -type d \
49
+ \( \
50
+ -path ./.git -o \
51
+ -path ./node_modules \
52
+ $(printf " -o -path ./%s" $branches) \
53
+ \) -prune \
54
+ -o -mindepth 1 -type d \
55
+ -exec rm -rfv {} \;
56
57
# Push
58
git add -u
0 commit comments