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

10 statements  

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

1from pathlib import Path 1abcdefgh

2 

3import typer 1abcdefgh

4 

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

6 

7app = typer.Typer() 1abcdefgh

8 

9 

10@app.command() 1abcdefgh

11def main(): 1abcdefgh

12 app_dir = typer.get_app_dir(APP_NAME) 1abcdefgh

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

14 if not config_path.is_file(): 1abcdefgh

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

16 

17 

18if __name__ == "__main__": 1abcdefgh

19 app() 1abcdefgh