From 3db513cfc9e254483a0abbc375d8bf1cd7b97e7c Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 15 May 2020 16:08:10 +0100 Subject: [PATCH] record latexmk output --- services/clsi/app/js/CompileManager.js | 5 +++++ services/clsi/app/js/ResourceWriter.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/services/clsi/app/js/CompileManager.js b/services/clsi/app/js/CompileManager.js index 3bf54bc75b..500adfcea0 100644 --- a/services/clsi/app/js/CompileManager.js +++ b/services/clsi/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/services/clsi/app/js/ResourceWriter.js b/services/clsi/app/js/ResourceWriter.js index ed3a1e8760..750be323ba 100644 --- a/services/clsi/app/js/ResourceWriter.js +++ b/services/clsi/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