mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
run chktex when request has check:true
This commit is contained in:
parent
3135ff2842
commit
d6d6e18b89
4 changed files with 13 additions and 4 deletions
|
@ -27,6 +27,10 @@ module.exports = CommandRunner =
|
|||
err = new Error("terminated")
|
||||
err.terminated = true
|
||||
return callback(err)
|
||||
else if code
|
||||
err = new Error("exit")
|
||||
err.code = code
|
||||
return callback(err)
|
||||
else
|
||||
callback()
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ module.exports = CompileController =
|
|||
CompileManager.doCompile request, (error, outputFiles = []) ->
|
||||
if error?.terminated
|
||||
status = "terminated"
|
||||
else if error?.code is 1
|
||||
status = "exited"
|
||||
else if error?
|
||||
logger.error err: error, project_id: request.project_id, "error running compile"
|
||||
if error.timedout
|
||||
|
|
|
@ -44,9 +44,9 @@ module.exports = CompileManager =
|
|||
|
||||
# set up environment variables for chktex
|
||||
env = {}
|
||||
if request.chktex?
|
||||
env['CHKTEX_OPTIONS'] = '-nall -e9 -e10 -e15 -e16 -e27'
|
||||
if request.chktex is 'error'
|
||||
if request.check?
|
||||
env['CHKTEX_OPTIONS'] = '-nall -e9 -e10 -w15 -w16 -w27'
|
||||
if request.check is 'error'
|
||||
env['CHKTEX_EXIT_ON_ERROR'] = 1
|
||||
|
||||
injectDraftModeIfRequired (error) ->
|
||||
|
@ -67,7 +67,7 @@ module.exports = CompileManager =
|
|||
environment: env
|
||||
}, (error, output, stats, timings) ->
|
||||
# compile was killed by user
|
||||
if error?.terminated
|
||||
if error?.terminated or error?.code is 1
|
||||
OutputFileFinder.findOutputFiles request.resources, compileDir, (err, outputFiles) ->
|
||||
return callback(err) if err?
|
||||
callback(error, outputFiles) # return output files so user can check logs
|
||||
|
|
|
@ -28,6 +28,9 @@ module.exports = RequestParser =
|
|||
compile.options.draft,
|
||||
default: false,
|
||||
type: "boolean"
|
||||
response.check = @_parseAttribute "check",
|
||||
compile.options.check,
|
||||
type: "string"
|
||||
|
||||
if response.timeout > RequestParser.MAX_TIMEOUT
|
||||
response.timeout = RequestParser.MAX_TIMEOUT
|
||||
|
|
Loading…
Reference in a new issue