cleantree.sh 400 B

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