]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🐛 Fix docs script to generate a new translation language with overrides boilerplate...
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 10 May 2021 07:15:39 +0000 (09:15 +0200)
committerGitHub <noreply@github.com>
Mon, 10 May 2021 07:15:39 +0000 (09:15 +0200)
scripts/docs.py

index ec3ad76e65e23a859e0c43537067c26b8b831219..40569e193d23e384c2ea8b4134d2e9ef4e35602b 100644 (file)
@@ -106,6 +106,9 @@ def new_lang(lang: str = typer.Argument(..., callback=lang_callback)):
     en_index_content = en_index_path.read_text(encoding="utf-8")
     new_index_content = f"{missing_translation_snippet}\n\n{en_index_content}"
     new_index_path.write_text(new_index_content, encoding="utf-8")
+    new_overrides_gitignore_path = new_path / "overrides" / ".gitignore"
+    new_overrides_gitignore_path.parent.mkdir(parents=True, exist_ok=True)
+    new_overrides_gitignore_path.write_text("")
     typer.secho(f"Successfully initialized: {new_path}", color=typer.colors.GREEN)
     update_languages(lang=None)