feat: add confirmation step before opening GitHub issue in browser

This commit is contained in:
Paul Gauthier (aider) 2024-08-29 07:34:39 -07:00
parent 56a88018a9
commit f89f42491c

View file

@ -23,6 +23,14 @@ def report_github_issue(issue_text, title=None):
params["title"] = title
issue_url = f"{base_url}?{urllib.parse.urlencode(params)}"
print("\nIssue Title:")
print(title)
print("\nIssue Body:")
print(issue_text)
print("\nDo you want to open this issue in your browser? (y/n)")
confirmation = input().strip().lower()
if confirmation == 'y':
try:
print("Attempting to open the issue URL in your default web browser...")
if webbrowser.open(issue_url):
@ -34,6 +42,8 @@ def report_github_issue(issue_text, title=None):
print("Please use this URL to file a GitHub issue:")
print()
print(issue_url)
else:
print("Issue creation cancelled.")
if __name__ == "__main__":