mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
Merge pull request #1056 from aelaguiz/ls_read_only
feat: Add read-only files to the output of the 'ls' command
This commit is contained in:
commit
d5aaa9a2a5
1 changed files with 13 additions and 2 deletions
|
@ -752,6 +752,7 @@ class Commands:
|
|||
|
||||
other_files = []
|
||||
chat_files = []
|
||||
read_only_files = []
|
||||
for file in files:
|
||||
abs_file_path = self.coder.abs_root_path(file)
|
||||
if abs_file_path in self.coder.abs_fnames:
|
||||
|
@ -759,8 +760,13 @@ class Commands:
|
|||
else:
|
||||
other_files.append(file)
|
||||
|
||||
if not chat_files and not other_files:
|
||||
self.io.tool_output("\nNo files in chat or git repo.")
|
||||
# Add read-only files
|
||||
for abs_file_path in self.coder.abs_read_only_fnames:
|
||||
rel_file_path = self.coder.get_rel_fname(abs_file_path)
|
||||
read_only_files.append(rel_file_path)
|
||||
|
||||
if not chat_files and not other_files and not read_only_files:
|
||||
self.io.tool_output("\nNo files in chat, git repo, or read-only list.")
|
||||
return
|
||||
|
||||
if other_files:
|
||||
|
@ -768,6 +774,11 @@ class Commands:
|
|||
for file in other_files:
|
||||
self.io.tool_output(f" {file}")
|
||||
|
||||
if read_only_files:
|
||||
self.io.tool_output("\nRead-only files:\n")
|
||||
for file in read_only_files:
|
||||
self.io.tool_output(f" {file}")
|
||||
|
||||
if chat_files:
|
||||
self.io.tool_output("\nFiles in chat:\n")
|
||||
for file in chat_files:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue