A perhaps too-baroque way to clean files but also keep some.

This commit is contained in:
Ned Batchelder
2016-11-10 10:55:11 -05:00
parent 496aaa5455
commit 45f92f73de
2 changed files with 13 additions and 0 deletions

4
.gitignore vendored
View File

@@ -3,9 +3,13 @@
### Files private to developers
# Files that should be git-ignored, but are hand-edited or otherwise valued,
# and so should not be destroyed by "make clean".
# start-noclean
requirements/private.txt
lms/envs/private.py
cms/envs/private.py
# end-noclean
### Python artifacts
*.pyc

9
Makefile Normal file
View File

@@ -0,0 +1,9 @@
# Do things in edx-platform
clean:
# Remove all the git-ignored stuff, but save and restore things marked
# by start-noclean/end-noclean.
sed -n -e '/start-noclean/,/end-noclean/p' < .gitignore > /tmp/private-files
tar cf /tmp/private.tar `git ls-files --exclude-from=/tmp/private-files --ignored --others`
git clean -fdX
tar xf /tmp/private.tar