Commit cba73414 by Ned Batchelder Committed by GitHub

Merge pull request #14677 from edx/nedbat/safer-make-clean

Safer "make clean"
parents 291945b6 f7f16b0a
# Do things in edx-platform # Do things in edx-platform
# Careful with mktemp syntax: it has to work on Mac and Ubuntu, which have differences.
PRIVATE_FILES := $(shell mktemp -u /tmp/private_files.XXXXXX)
clean: clean:
# Remove all the git-ignored stuff, but save and restore things marked # Remove all the git-ignored stuff, but save and restore things marked
# by start-noclean/end-noclean. # by start-noclean/end-noclean. Include Makefile in the tarball so that
# there's always at least one file even if there are no private files.
sed -n -e '/start-noclean/,/end-noclean/p' < .gitignore > /tmp/private-files 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` -tar cf $(PRIVATE_FILES) Makefile `git ls-files --exclude-from=/tmp/private-files --ignored --others`
git clean -fdX -git clean -fdX
tar xf /tmp/private.tar tar xf $(PRIVATE_FILES)
rm $(PRIVATE_FILES)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment