change where !replay looks for its infile

!fetch puts its output file into the output directory; it may be beneficial to have !replay look in the output directory as well.
This commit is contained in:
Thomas 2023-04-06 08:14:11 -04:00 committed by GitHub
parent 85b020f76c
commit 7268131f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -581,6 +581,7 @@ def do_command(command: str, gen, opt: Args, completer) -> tuple:
elif command.startswith("!replay"):
file_path = command.replace("!replay", "", 1).strip()
file_path = os.path.join(opt.outdir, file_path)
if infile is None and os.path.isfile(file_path):
infile = open(file_path, "r", encoding="utf-8")
completer.add_history(command)