mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
provide validation mode where compilation always exits after chktex
This commit is contained in:
parent
d6d6e18b89
commit
ffea361d12
2 changed files with 9 additions and 3 deletions
|
@ -17,8 +17,8 @@ module.exports = CompileController =
|
||||||
CompileManager.doCompile request, (error, outputFiles = []) ->
|
CompileManager.doCompile request, (error, outputFiles = []) ->
|
||||||
if error?.terminated
|
if error?.terminated
|
||||||
status = "terminated"
|
status = "terminated"
|
||||||
else if error?.code is 1
|
else if error?.validate
|
||||||
status = "exited"
|
status = "validation-#{error.validate}"
|
||||||
else if error?
|
else if error?
|
||||||
logger.error err: error, project_id: request.project_id, "error running compile"
|
logger.error err: error, project_id: request.project_id, "error running compile"
|
||||||
if error.timedout
|
if error.timedout
|
||||||
|
|
|
@ -48,6 +48,8 @@ module.exports = CompileManager =
|
||||||
env['CHKTEX_OPTIONS'] = '-nall -e9 -e10 -w15 -w16 -w27'
|
env['CHKTEX_OPTIONS'] = '-nall -e9 -e10 -w15 -w16 -w27'
|
||||||
if request.check is 'error'
|
if request.check is 'error'
|
||||||
env['CHKTEX_EXIT_ON_ERROR'] = 1
|
env['CHKTEX_EXIT_ON_ERROR'] = 1
|
||||||
|
if request.check is 'validate'
|
||||||
|
env['CHKTEX_VALIDATE'] = 1
|
||||||
|
|
||||||
injectDraftModeIfRequired (error) ->
|
injectDraftModeIfRequired (error) ->
|
||||||
return callback(error) if error?
|
return callback(error) if error?
|
||||||
|
@ -66,8 +68,12 @@ module.exports = CompileManager =
|
||||||
image: request.imageName
|
image: request.imageName
|
||||||
environment: env
|
environment: env
|
||||||
}, (error, output, stats, timings) ->
|
}, (error, output, stats, timings) ->
|
||||||
|
if request.check is "validate"
|
||||||
|
result = if error?.code then "fail" else "pass"
|
||||||
|
error = new Error("validation")
|
||||||
|
error.validate = result
|
||||||
# compile was killed by user
|
# compile was killed by user
|
||||||
if error?.terminated or error?.code is 1
|
if error?.terminated or error?.validate
|
||||||
OutputFileFinder.findOutputFiles request.resources, compileDir, (err, outputFiles) ->
|
OutputFileFinder.findOutputFiles request.resources, compileDir, (err, outputFiles) ->
|
||||||
return callback(err) if err?
|
return callback(err) if err?
|
||||||
callback(error, outputFiles) # return output files so user can check logs
|
callback(error, outputFiles) # return output files so user can check logs
|
||||||
|
|
Loading…
Reference in a new issue