use Path.touch() to create new files

This commit is contained in:
Paul Gauthier 2023-07-05 15:44:12 -07:00
parent b3d624b7cd
commit bc60e7fd1c

View file

@ -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))