From bc60e7fd1c0ae1b79dae6feaf85f80ac80e46ac0 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 5 Jul 2023 15:44:12 -0700 Subject: [PATCH] use Path.touch() to create new files --- aider/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index 29f4bc63b..a262f9c8d 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -3,6 +3,7 @@ import os import shlex import subprocess import sys +from pathlib import Path import git import tiktoken @@ -238,8 +239,8 @@ class Commands: ) if create_file: - with open(os.path.join(self.coder.root, word), "w"): - pass + (Path(self.coder.root) / word).touch() + matched_files = [word] if self.coder.repo is not None: self.coder.repo.git.add(os.path.join(self.coder.root, word))