Coverage for docs_src / app_dir / tutorial001.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-11-18 11:12 +0000

1from pathlib import Path 1abcdefghij

2 

3import typer 1abcdefghij

4 

5APP_NAME = "my-super-cli-app" 1abcdefghij

6 

7app = typer.Typer() 1abcdefghij

8 

9 

10@app.command() 1abcdefghij

11def main(): 1abcdefghij

12 app_dir = typer.get_app_dir(APP_NAME) 1abcdefghij

13 config_path: Path = Path(app_dir) / "config.json" 1abcdefghij

14 if not config_path.is_file(): 1abcdefghij

15 print("Config file doesn't exist yet") 1abcdefghij

16 

17 

18if __name__ == "__main__": 1abcdefghij

19 app() 1abcdefghij