mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
feat: add confirmation step before opening GitHub issue in browser
This commit is contained in:
parent
56a88018a9
commit
f89f42491c
1 changed files with 21 additions and 11 deletions
|
@ -23,17 +23,27 @@ def report_github_issue(issue_text, title=None):
|
||||||
params["title"] = title
|
params["title"] = title
|
||||||
issue_url = f"{base_url}?{urllib.parse.urlencode(params)}"
|
issue_url = f"{base_url}?{urllib.parse.urlencode(params)}"
|
||||||
|
|
||||||
try:
|
print("\nIssue Title:")
|
||||||
print("Attempting to open the issue URL in your default web browser...")
|
print(title)
|
||||||
if webbrowser.open(issue_url):
|
print("\nIssue Body:")
|
||||||
print("Browser window should be opened.")
|
print(issue_text)
|
||||||
else:
|
print("\nDo you want to open this issue in your browser? (y/n)")
|
||||||
print("Unable to open browser window automatically.")
|
confirmation = input().strip().lower()
|
||||||
except Exception:
|
|
||||||
print()
|
if confirmation == 'y':
|
||||||
print("Please use this URL to file a GitHub issue:")
|
try:
|
||||||
print()
|
print("Attempting to open the issue URL in your default web browser...")
|
||||||
print(issue_url)
|
if webbrowser.open(issue_url):
|
||||||
|
print("Browser window should be opened.")
|
||||||
|
else:
|
||||||
|
print("Unable to open browser window automatically.")
|
||||||
|
except Exception:
|
||||||
|
print()
|
||||||
|
print("Please use this URL to file a GitHub issue:")
|
||||||
|
print()
|
||||||
|
print(issue_url)
|
||||||
|
else:
|
||||||
|
print("Issue creation cancelled.")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue