From 5ab45c1031d37414d77e42aff2db7459d63e2e52 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 15 May 2020 16:08:10 +0100 Subject: [PATCH] record latexmk output --- app/js/CompileManager.js | 5 +++++ app/js/ResourceWriter.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/app/js/CompileManager.js b/app/js/CompileManager.js index 3bf54bc..500adfc 100644 --- a/app/js/CompileManager.js +++ b/app/js/CompileManager.js @@ -217,6 +217,11 @@ module.exports = CompileManager = { error = new Error('compilation') error.validate = 'fail' } + // make top-level output accesible to user, write in background for simplicity + if (output != null) { + fs.writeFile(Path.join(compileDir, "output.stdout"), output.stdout, () => { }) + fs.writeFile(Path.join(compileDir, "output.stderr"), output.stderr, () => { }) + } // compile was killed by user, was a validation, or a compile which failed validation if ( (error != null ? error.terminated : undefined) || diff --git a/app/js/ResourceWriter.js b/app/js/ResourceWriter.js index ed3a1e8..750be32 100644 --- a/app/js/ResourceWriter.js +++ b/app/js/ResourceWriter.js @@ -201,6 +201,10 @@ module.exports = ResourceWriter = { // knitr cache should_delete = false } + if (path.match(/^output.(stdout|stderr)$/)) { + // latexmk output + should_delete = true + } if (path.match(/^output-.*/)) { // Tikz cached figures (default case) should_delete = false