We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f90e7cc commit a2da74fCopy full SHA for a2da74f
src/faff_cli/main.py
@@ -23,7 +23,11 @@
23
24
@cli.callback()
25
def main(ctx: typer.Context):
26
- ctx.obj = Workspace()
+ # Don't create workspace for init command - it doesn't need one
27
+ if ctx.invoked_subcommand == "init":
28
+ ctx.obj = None
29
+ else:
30
+ ctx.obj = Workspace()
31
32
@cli.command()
33
def init(ctx: typer.Context,
@@ -33,8 +37,7 @@ def init(ctx: typer.Context,
37
cli: faff init
34
38
Initialise faff obj.
35
39
"""
36
- ws: Workspace = ctx.obj
-
40
+ # init doesn't need a workspace - ctx.obj will be None
41
target_dir = Path(target_dir_str)
42
if not target_dir.exists():
43
typer.echo(f"Target directory {target_dir} does not exist.")
0 commit comments