summaryrefslogtreecommitdiff
path: root/run_latex.py
diff options
context:
space:
mode:
Diffstat (limited to 'run_latex.py')
-rw-r--r--run_latex.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/run_latex.py b/run_latex.py
index 9f4b75e..64220c0 100644
--- a/run_latex.py
+++ b/run_latex.py
@@ -21,6 +21,11 @@ import shutil
import subprocess
import sys
+# Copy any existing build cache here.
+cache_dir = "/tmp/bazel-latex.cache"
+if os.path.exists(cache_dir) and os.path.isdir(cache_dir):
+ shutil.copytree(cache_dir, "latex.out")
+
texlive, latexrun, job_name, main_file, output_file = sys.argv[1:6]
sources = sys.argv[6:]
if output_file == "--":
@@ -56,6 +61,11 @@ return_code = subprocess.call(
env=env,
)
+# Copy back to the build cache.
+if os.path.exists(cache_dir):
+ shutil.rmtree(cache_dir)
+shutil.copytree("latex.out", cache_dir)
+
if return_code != 0:
sys.exit(return_code)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback