summaryrefslogtreecommitdiff
path: root/texgen.py
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-06-04 16:29:40 +0800
committerKeuin <[email protected]>2023-06-04 16:34:03 +0800
commita3b775c175c748516f327d902529229c8156bb5a (patch)
tree2b69b4ca91724b507eac820eb70efa5129aeedd9 /texgen.py
parentc9e52fbed5d5d42e319e17945ed5ab8a59274552 (diff)
bugfix: cache does not work across devices
Diffstat (limited to 'texgen.py')
-rw-r--r--texgen.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/texgen.py b/texgen.py
index 3a2964d..73277fc 100644
--- a/texgen.py
+++ b/texgen.py
@@ -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