@@ -29,13 +29,14 @@ def get_app_config(path_to_deploy: Path) -> Optional[AppConfig]:
2929
3030> Should I commit the ".fastapi" folder?
3131No, you should not commit the ".fastapi" folder to your version control system.
32- On creation, it will be automatically added to your ".gitignore" file.
32+ That's why we there's a ".gitignore" file in this folder .
3333"""
3434
3535
3636def write_app_config (path_to_deploy : Path , app_config : AppConfig ) -> None :
3737 config_path = path_to_deploy / ".fastapi/cloud.json"
3838 readme_path = path_to_deploy / ".fastapi/README.md"
39+ gitignore_path = path_to_deploy / ".fastapi/.gitignore"
3940 config_path .parent .mkdir (parents = True , exist_ok = True )
4041
4142 config_path .write_text (
@@ -44,14 +45,4 @@ def write_app_config(path_to_deploy: Path, app_config: AppConfig) -> None:
4445 )
4546 readme_path .write_text (README , encoding = "utf-8" )
4647
47- git_ignore_path = path_to_deploy / ".gitignore"
48-
49- if not git_ignore_path .exists ():
50- git_ignore_path .write_text (".fastapi\n " , encoding = "utf-8" )
51- else :
52- git_ignore_content = git_ignore_path .read_text (encoding = "utf-8" )
53-
54- if ".fastapi" not in git_ignore_content :
55- git_ignore_path .write_text (
56- f"{ git_ignore_content } .fastapi\n " , encoding = "utf-8"
57- )
48+ gitignore_path .write_text ("*" )
0 commit comments