Skip to content

Commit

Permalink
Improve the check for asciinema start when using --append
Browse files Browse the repository at this point in the history
Previously, we checked if the tool printed 'recording asciicast to
<path>'. This text is only present when the output file is not present, or when
an --overwrite flag was passed to asciinema. When the --append flag is used, a
different message is printed by asciinema, and this commit checks for that.
  • Loading branch information
punchagan authored and PierreMarchand20 committed Dec 11, 2023
1 parent 615a87d commit 73fad35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion asciinema_automation/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ def execute(self):
self.process.expect("\n")
logger.debug(self.process.before)
if not (
"recording asciicast to " + str(self.outputfile) in str(self.process.before)
f"recording asciicast to {self.outputfile}" in str(self.process.before)
or f"appending to asciicast at {self.outputfile}"
in str(self.process.before)
):
self.process.expect(pexpect.EOF)
self.process.close()
Expand Down

0 comments on commit 73fad35

Please sign in to comment.