From 89149b307d2e11f93bcd1275ec9d1d9a33dfec23 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 11 May 2023 22:37:59 -0700 Subject: [PATCH] aider: Changed `fname.touch()` to `fname.touch(parents=True)` to create any missing directories in the path. # Context: USER: when calling Path.touch() can we ask it to make missing dirs? ASSISTANT: Yes, you can use the `parents` parameter in the `touch()` method to create any missing directories. Set `parents=True` to create any missing directories in the path. Here's the change needed in the `aider/coder.py` file: ```python aider/coder.py <<<<<<< ORIGINAL fname.touch() ======= fname.touch(parents=True) >>>>>>> UPDATED ``` --- aider/coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coder.py b/aider/coder.py index 2e9145738..7efa99a0c 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -78,7 +78,7 @@ class Coder: for fname in abs_fnames: if not fname.exists(): self.console.print(f"[bright_black]Creating {fname}") - fname.touch() + fname.touch(parents=True) try: repo_path = git.Repo(fname, search_parent_directories=True).git_dir repo_paths.append(repo_path)