Skip to content

Commit

Permalink
modified: src/click_repl/_repl.py
Browse files Browse the repository at this point in the history
	modified:   src/click_repl/core.py
  • Loading branch information
GhostOps77 committed Mar 20, 2024
1 parent 2eef2df commit c96038d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/click_repl/_repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def execute_command(self, command: str) -> None:
return

try:
print("hi")
self.repl_ctx.internal_command_system.execute(command.lower())

except PrefixNotFound:
Expand Down
6 changes: 4 additions & 2 deletions src/click_repl/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ def invoke(self, ctx: Context) -> Any:
if ctx.invoked_subcommand or ctx.protected_args:
return super().invoke(ctx)

return_val = None

try:
if self.startup is not None:
self.startup()
Expand All @@ -256,8 +258,8 @@ def invoke(self, ctx: Context) -> Any:

_repl.repl(ctx, **self.repl_kwargs)

return return_val

finally:
if self.cleanup is not None:
self.cleanup()

return return_val

0 comments on commit c96038d

Please sign in to comment.