cleantree.sh 658 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. # -*- coding: utf-8 -*-
  3. basedir="$(realpath "$0" | xargs dirname)"
  4. info()
  5. {
  6. echo "--- $*"
  7. }
  8. error()
  9. {
  10. echo "=== ERROR: $*" >&2
  11. }
  12. warning()
  13. {
  14. echo "=== WARNING: $*" >&2
  15. }
  16. die()
  17. {
  18. error "$*"
  19. exit 1
  20. }
  21. [ -x "$basedir/setup.py" -a -f "$basedir/Cargo.toml" ] ||\
  22. die "basedir sanity check failed"
  23. cd "$basedir" || die "cd basedir failed."
  24. find . \( \
  25. \( -name '__pycache__' \) -o \
  26. \( -name '*.pyo' \) -o \
  27. \( -name '*.pyc' \) -o \
  28. \( -name '*$py.class' \) \
  29. \) -delete
  30. rm -f cms_cython
  31. rm -rf build dist .pybuild
  32. rm -f MANIFEST
  33. rm -rf target
  34. rm -f Cargo.lock cms-fsd.sock
  35. # vim: ts=4 sw=4 expandtab