(self, path: PATH_TYPES, dry_run: bool = False)
return 0
Delete the provided path.
Delete the provided path.
Delete the provided path .
def delete(self, path: PATH_TYPES, dry_run: bool = False) -> int:
        """Delete the provided path."""
        if not isinstance(path, pathlib.Path):
            path = pathlib.Path(path)
        log_prefix = "[DRY RUN] " if dry_run else ""
        logger.info(f"{log_prefix}Deleting path: {path!s}")
        if not dry_run:
            if not self.exists(path):
                logger.debug(f"{path!s} does not exist. Skipping")
                return 0
            if self.is_file(path):
                return self.delete_file(path, dry_run=dry_run)
            else:
                return self.rmdir(path, dry_run=dry_run, force=True)
        return 0
def delete ( self , path : PATH_TYPES , dry_run : bool = False ) -> int : if not isinstance ( path , pathlib . Path ) : path = pathlib . Path ( path ) log_prefix = "[DRY RUN] " if dry_run else "" logger . info ( f"{log_prefix}Deleting path: {path!s}" ) if not dry_run : if not self . exists ( path ) : logger . debug ( f"{path!s} does not exist. Skipping" ) return 0 if self . is_file ( path ) : return self . delete_file ( path , dry_run = dry_run ) else : return self . rmdir ( path , dry_run = dry_run , force = True ) return 0