mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
prompt for new files
This commit is contained in:
parent
1b72656618
commit
557bf5ae76
1 changed files with 12 additions and 0 deletions
12
coder.py
12
coder.py
|
@ -6,6 +6,7 @@ import readline
|
|||
import traceback
|
||||
import argparse
|
||||
from rich.console import Console
|
||||
from rich.prompt import Confirm
|
||||
from colorama import Fore, Style
|
||||
from rich.live import Live
|
||||
from rich.text import Text
|
||||
|
@ -312,6 +313,17 @@ class Coder:
|
|||
for match in self.pattern.finditer(content):
|
||||
_, path, _, original, updated = match.groups()
|
||||
|
||||
if path not in self.fnames:
|
||||
if not Path(path).exists():
|
||||
question = f"[red bold]Allow creation of new file {path}?"
|
||||
else:
|
||||
question = f"[red bold]Allow edits to {path} which was not previously provided?"
|
||||
if not Confirm.ask(question, console=self.console):
|
||||
self.console.print(f"[red]Skipping edit to {path}")
|
||||
continue
|
||||
|
||||
self.fnames[path] = 0
|
||||
|
||||
edited.add(path)
|
||||
if self.do_replace(path, original, updated):
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue