mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 21:04:59 +00:00
feat: add --yes flag to auto-close duplicate issues without prompting
This commit is contained in:
parent
eb8fdf483e
commit
e9627cb3c6
1 changed files with 11 additions and 7 deletions
|
@ -1,7 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
add a --yes switch @ai
|
import argparse
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
@ -114,6 +113,10 @@ def comment_and_close_duplicate(issue, oldest_issue):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Handle duplicate GitHub issues')
|
||||||
|
parser.add_argument('--yes', action='store_true', help='Automatically close duplicates without prompting')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
if not TOKEN:
|
if not TOKEN:
|
||||||
print("Error: Missing GITHUB_TOKEN environment variable. Please check your .env file.")
|
print("Error: Missing GITHUB_TOKEN environment variable. Please check your .env file.")
|
||||||
return
|
return
|
||||||
|
@ -144,6 +147,7 @@ def main():
|
||||||
f" {oldest_issue['html_url']} ({oldest_issue['state']})"
|
f" {oldest_issue['html_url']} ({oldest_issue['state']})"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not args.yes:
|
||||||
# Confirmation prompt
|
# Confirmation prompt
|
||||||
confirm = input("Do you want to comment and close duplicate issues? (y/n): ")
|
confirm = input("Do you want to comment and close duplicate issues? (y/n): ")
|
||||||
if confirm.lower() != "y":
|
if confirm.lower() != "y":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue