Creates directory if it doesn't exist and logs; throws exception on error
(path: AnyStr)
| 42 | |
| 43 | |
| 44 | def create_if_not_exist_path(path: AnyStr): |
| 45 | """Creates directory if it doesn't exist and logs; throws exception on error""" |
| 46 | if not os.path.exists(path): |
| 47 | try: |
| 48 | os.makedirs(path) |
| 49 | logger.info(f"Created {path}") |
| 50 | except FileExistsError: |
| 51 | pass |
| 52 | |
| 53 | |
| 54 | def create_if_not_exist(func: Callable[..., AnyStr]) -> Callable[..., AnyStr]: |