wip: Changed file path handling and edited file tracking in Coder class.

This commit is contained in:
Paul Gauthier 2023-05-10 09:32:45 -07:00
parent c725a830b8
commit 28584b5705

View file

@ -349,8 +349,10 @@ class Coder:
path = path.strip()
if path not in self.fnames:
if not Path(path).exists():
full_path = os.path.join(self.root, path)
if full_path not in self.fnames:
if not Path(full_path).exists():
question = f"[red]Allow creation of new file {path}?"
else:
question = (
@ -362,8 +364,7 @@ class Coder:
self.fnames.add(path)
full_path = os.path.join(self.root, path)
edited.add(full_path)
edited.add(path)
if utils.do_replace(full_path, original, updated):
self.console.print(f"[red]Applied edit to {path}")
else: