mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Fix rmtree in translation script on MacOS (#129352)
This commit is contained in:
parent
9db6be11f7
commit
9a1b965c7f
@ -4,7 +4,6 @@ import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
from shutil import rmtree
|
||||
import sys
|
||||
|
||||
from . import download, upload
|
||||
@ -83,9 +82,10 @@ def run_single(translations, flattened_translations, integration):
|
||||
)
|
||||
|
||||
if download.DOWNLOAD_DIR.is_dir():
|
||||
rmtree(str(download.DOWNLOAD_DIR))
|
||||
|
||||
download.DOWNLOAD_DIR.mkdir(parents=True)
|
||||
for lang_file in download.DOWNLOAD_DIR.glob("*.json"):
|
||||
lang_file.unlink()
|
||||
else:
|
||||
download.DOWNLOAD_DIR.mkdir(parents=True)
|
||||
|
||||
(download.DOWNLOAD_DIR / "en.json").write_text(
|
||||
json.dumps({"component": {integration: translations["component"][integration]}})
|
||||
|
Loading…
x
Reference in New Issue
Block a user