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 shlex
import subprocess import subprocess
import sys import sys
from pathlib import Path
import git import git
import tiktoken import tiktoken
@ -238,8 +239,8 @@ class Commands:
) )
if create_file: if create_file:
with open(os.path.join(self.coder.root, word), "w"): (Path(self.coder.root) / word).touch()
pass
matched_files = [word] matched_files = [word]
if self.coder.repo is not None: if self.coder.repo is not None:
self.coder.repo.git.add(os.path.join(self.coder.root, word)) self.coder.repo.git.add(os.path.join(self.coder.root, word))