handle piped input for canned asciinema demos

This commit is contained in:
Paul Gauthier 2023-05-09 14:39:57 -07:00
parent 9b734cb149
commit 4c97799b42
2 changed files with 31 additions and 23 deletions

View file

@ -164,6 +164,8 @@ class Coder:
if self.num_control_c >= 2:
break
self.console.print("[bold red]^C again to quit")
except EOFError:
return
def run_loop(self):
if self.pretty:
@ -336,6 +338,8 @@ class Coder:
for match in self.pattern.finditer(content):
_, path, _, _, original, updated = match.groups()
path = path.strip()
if path not in self.fnames:
if not Path(path).exists():
question = f"[red bold]Allow creation of new file {path}?"