diff options
author | Keuin <[email protected]> | 2023-06-04 16:29:40 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-06-04 16:34:03 +0800 |
commit | a3b775c175c748516f327d902529229c8156bb5a (patch) | |
tree | 2b69b4ca91724b507eac820eb70efa5129aeedd9 | |
parent | c9e52fbed5d5d42e319e17945ed5ab8a59274552 (diff) |
bugfix: cache does not work across devices
-rw-r--r-- | texgen.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -3,6 +3,7 @@ import asyncio.subprocess as subprocess import contextlib import hashlib import os +import shlex import shutil from aiofile import async_open @@ -61,5 +62,9 @@ class TexGenerator: raise TexGenerationError('xelatex timed out') if proc.returncode != 0: raise TexGenerationError(f'xelatex process exited with non-zero code {proc.returncode}') - os.rename(os.path.join(workdir, f'{job_name}.pdf'), cache_file_path) + os.system(' '.join([ + 'mv', + shlex.quote(os.path.join(workdir, f'{job_name}.pdf')), + shlex.quote(cache_file_path), + ])) return cache_file_path |