mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
refactor: consolidate analytics exit events in main function
This commit is contained in:
parent
accde0bfd0
commit
ed2479ea82
1 changed files with 4 additions and 2 deletions
|
@ -64,7 +64,6 @@ def guessed_wrong_repo(io, git_root, fnames, git_dname):
|
||||||
try:
|
try:
|
||||||
check_repo = Path(GitRepo(io, fnames, git_dname).root).resolve()
|
check_repo = Path(GitRepo(io, fnames, git_dname).root).resolve()
|
||||||
except (OSError,) + ANY_GIT_ERROR:
|
except (OSError,) + ANY_GIT_ERROR:
|
||||||
analytics.event("exit", reason="Processed message file")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# we had no guess, rely on the "true" repo result
|
# we had no guess, rely on the "true" repo result
|
||||||
|
@ -149,7 +148,6 @@ def check_gitignore(git_root, io, ask=True):
|
||||||
try:
|
try:
|
||||||
repo = git.Repo(git_root)
|
repo = git.Repo(git_root)
|
||||||
if repo.ignored(".aider") and repo.ignored(".env"):
|
if repo.ignored(".aider") and repo.ignored(".env"):
|
||||||
analytics.event("exit", reason="Normal completion")
|
|
||||||
return
|
return
|
||||||
except ANY_GIT_ERROR:
|
except ANY_GIT_ERROR:
|
||||||
pass
|
pass
|
||||||
|
@ -903,6 +901,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
coder.run(with_message=args.message)
|
coder.run(with_message=args.message)
|
||||||
except SwitchCoder:
|
except SwitchCoder:
|
||||||
pass
|
pass
|
||||||
|
analytics.event("exit", reason="Completed --message")
|
||||||
return
|
return
|
||||||
|
|
||||||
if args.message_file:
|
if args.message_file:
|
||||||
|
@ -918,6 +917,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
io.tool_error(f"Error reading message file: {e}")
|
io.tool_error(f"Error reading message file: {e}")
|
||||||
analytics.event("exit", reason="Message file IO error")
|
analytics.event("exit", reason="Message file IO error")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
analytics.event("exit", reason="Completed --message-file")
|
||||||
return
|
return
|
||||||
|
|
||||||
if args.exit:
|
if args.exit:
|
||||||
|
@ -929,6 +930,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
coder.run()
|
coder.run()
|
||||||
|
analytics.event("exit", reason="Completed main CLI coder.run")
|
||||||
return
|
return
|
||||||
except SwitchCoder as switch:
|
except SwitchCoder as switch:
|
||||||
kwargs = dict(io=io, from_coder=coder)
|
kwargs = dict(io=io, from_coder=coder)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue