From 73fad3556cb6252ed5fd6734d80c98533978ec0b Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Thu, 7 Dec 2023 13:11:03 +0530 Subject: [PATCH] Improve the check for asciinema start when using --append Previously, we checked if the tool printed 'recording asciicast to '. 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. --- asciinema_automation/script.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asciinema_automation/script.py b/asciinema_automation/script.py index 9b8f55e..e0a0b0b 100644 --- a/asciinema_automation/script.py +++ b/asciinema_automation/script.py @@ -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()