2024-07-18 16:02:25 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2024-07-18 16:22:22 +08:00
|
|
|
|
2024-07-18 16:02:25 +08:00
|
|
|
def list_files():
|
2024-07-18 16:22:22 +08:00
|
|
|
aider_files_path = os.path.join(".chat", ".aider_files")
|
|
|
|
|
2024-07-18 16:02:25 +08:00
|
|
|
# 确保.chat/.aider_files文件存在
|
|
|
|
if not os.path.exists(aider_files_path):
|
|
|
|
print("No files have been added to aider yet.")
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
# 读取文件列表
|
2024-07-18 16:22:22 +08:00
|
|
|
with open(aider_files_path, "r") as f:
|
2024-07-18 16:02:25 +08:00
|
|
|
files = [line.strip() for line in f]
|
|
|
|
|
|
|
|
# 打印文件列表
|
|
|
|
if files:
|
|
|
|
print("Aider files:")
|
|
|
|
for file in sorted(files):
|
|
|
|
print(f"- {file}")
|
|
|
|
else:
|
|
|
|
print("No files found in aider.")
|
|
|
|
|
2024-07-18 16:22:22 +08:00
|
|
|
|
2024-07-18 16:02:25 +08:00
|
|
|
def main():
|
|
|
|
list_files()
|
|
|
|
|
2024-07-18 16:22:22 +08:00
|
|
|
|
2024-07-18 16:02:25 +08:00
|
|
|
if __name__ == "__main__":
|
2024-07-18 16:22:22 +08:00
|
|
|
main()
|