(path)
| 42 | |
| 43 | @staticmethod |
| 44 | def _clean_path(path): |
| 45 | if os.path.exists(path): |
| 46 | logger.warning("🚨 %s already exists, remove it!", path) |
| 47 | try: |
| 48 | if os.path.isfile(path): |
| 49 | os.remove(path) |
| 50 | if os.path.isdir(path): |
| 51 | shutil.rmtree(path) |
| 52 | except OSError: |
| 53 | sys.exit(1) |
| 54 | else: |
| 55 | logger.warning("🚨 %s doesn't exist, no action taken", path) |
| 56 | |
| 57 | @job("clean all the previous assets generated by build tool") |
| 58 | def clean(self): |