mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
refactor: simplify file existence check and error handling in RepoMap
This commit is contained in:
parent
c8b2024f8b
commit
be1e45a4b3
1 changed files with 8 additions and 9 deletions
|
@ -307,16 +307,15 @@ class RepoMap:
|
||||||
if progress and not showing_bar:
|
if progress and not showing_bar:
|
||||||
progress()
|
progress()
|
||||||
|
|
||||||
if not Path(fname).is_file():
|
try:
|
||||||
if fname not in self.warned_files:
|
file_ok = Path(fname).is_file()
|
||||||
if Path(fname).exists():
|
except OSError:
|
||||||
self.io.tool_error(
|
file_ok = False
|
||||||
f"Repo-map can't include {fname}, it is not a normal file"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
self.io.tool_error(f"Repo-map can't include {fname}, it no longer exists")
|
|
||||||
|
|
||||||
self.warned_files.add(fname)
|
if not file_ok:
|
||||||
|
if fname not in self.warned_files:
|
||||||
|
self.io.tool_error(f"Repo-map can't include {fname}")
|
||||||
|
self.warned_files.add(fname)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# dump(fname)
|
# dump(fname)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue