Clean.sh 752 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. echo "Deleting ugly files..."
  3. ROOTDIR=".."
  4. EXTS="*.dcu *.ppu *.a *.dpu *.o *.rst *.bak *.bk? *.~* *.*~ *.or *.obj"
  5. EXTS=$EXTS" *.tgs *.tgw *.identcache *.local"
  6. delindir()
  7. {
  8. pushd $1 1>/dev/null
  9. echo "Processing dir: $1"
  10. rm -f `ls $EXTS 2>/dev/null `
  11. popd 1>/dev/null
  12. }
  13. delintree()
  14. {
  15. echo "Processing dir tree: $1"
  16. for EXT in $EXTS; do
  17. find $1 -name "$EXT" -exec rm -f {} \;
  18. done
  19. }
  20. delintree $ROOTDIR/Bin
  21. delintree $ROOTDIR/Demos
  22. delintree $ROOTDIR/Scripts
  23. delintree $ROOTDIR/Source/Tools
  24. delintree $ROOTDIR/Source/Wrappers
  25. delintree $ROOTDIR/Source/JpegLib
  26. delintree $ROOTDIR/Source/ZLib
  27. delintree $ROOTDIR/Source/Extensions
  28. delintree $ROOTDIR/Source/Projects
  29. delindir $ROOTDIR/Source
  30. echo "Clean finished"