fix: write scraped files whole or not at all

This commit is contained in:
Abdessamad Derraz committed 2026-10-10 04:45:10 +02:00
1 parent 170b7d93ae
commit a00f57ad37
7 files changed
+51 -19

No files matched your search

+5 -2
View File
@@ -28,8 +28,11 @@ class BaseTargetScraper(ABC):
import yaml
except ImportError:
raise ImportError("PyYAML required: pip install pyyaml")
with open(output_path, "w") as f:
yaml.dump(data, f, default_flow_style=False, sort_keys=False)
from common import write_text_atomic
write_text_atomic(
output_path, yaml.dump(data, default_flow_style=False, sort_keys=False)
)
_scrapers: dict[str, type] = {}