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

10 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-03-26 21:46 +0000

1from pathlib import Path 1abcdefg

2 

3import typer 1abcdefg

4 

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

6 

7app = typer.Typer() 1abcdefg

8 

9 

10@app.command() 1abcdefg

11def main(): 1abcdefg

12 app_dir = typer.get_app_dir(APP_NAME) 1abcdefg

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

14 if not config_path.is_file(): 1abcdefg

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

16 

17 

18if __name__ == "__main__": 1abcdefg

19 app() 1abcdefg