Write the ``data`` as YAML to the ``file_path`` in the ``base_path`` root directory. Create directories in the path as needed.
(base_path: Path, file_path: Path, data: dict)
| 196 | |
| 197 | |
| 198 | def write_file(base_path: Path, file_path: Path, data: dict): |
| 199 | """ |
| 200 | Write the ``data`` as YAML to the ``file_path`` in the ``base_path`` root directory. |
| 201 | Create directories in the path as needed. |
| 202 | """ |
| 203 | write_to = base_path / file_path |
| 204 | write_to.parent.mkdir(parents=True, exist_ok=True) |
| 205 | with open(write_to, encoding="utf-8", mode="w") as f: |
| 206 | f.write(saneyaml.dump(data)) |