cleantree.sh 453 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. basedir="$(dirname "$0")"
  3. [ "$(echo "$basedir" | cut -c1)" = '/' ] || basedir="$PWD/$basedir"
  4. base="$basedir/.."
  5. set -e
  6. if ! [ -x "$base/setup.py" ]; then
  7. echo "basedir sanity check failed"
  8. exit 1
  9. fi
  10. cd "$base"
  11. find . \( \
  12. \( -name '__pycache__' \) -o \
  13. \( -name '*.pyo' \) -o \
  14. \( -name '*.pyc' \) -o \
  15. \( -name '*$py.class' \) \
  16. \) -delete
  17. rm -rf doc/api
  18. rm -rf build dist .pybuild *.egg-info
  19. rm -f MANIFEST
  20. rm -f *.html