mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
788009330c
[CE/SP] Hotfix 4.2.7/5.0.7 GitOrigin-RevId: e36a5af392c2356d4068a98acc2d637d879392f8
22 lines
807 B
Diff
22 lines
807 B
Diff
--- a/services/clsi/app/js/LatexRunner.js
|
|
+++ b/services/clsi/app/js/LatexRunner.js
|
|
@@ -110,11 +110,14 @@ function _writeLogOutput(projectId, directory, output, callback) {
|
|
// internal method for writing non-empty log files
|
|
function _writeFile(file, content, cb) {
|
|
if (content && content.length > 0) {
|
|
- fs.writeFile(file, content, err => {
|
|
- if (err) {
|
|
- logger.error({ err, projectId, file }, 'error writing log file') // don't fail on error
|
|
- }
|
|
- cb()
|
|
+ fs.unlink(file, () => {
|
|
+ fs.writeFile(file, content, { flag: 'wx' }, err => {
|
|
+ if (err) {
|
|
+ // don't fail on error
|
|
+ logger.error({ err, projectId, file }, 'error writing log file')
|
|
+ }
|
|
+ cb()
|
|
+ })
|
|
})
|
|
} else {
|
|
cb()
|