mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #186 from overleaf/jpa-import-132
[LocalCommandRunner] run: block a double call of the callback
This commit is contained in:
commit
4489a080fd
1 changed files with 3 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
let CommandRunner
|
||||
const { spawn } = require('child_process')
|
||||
const _ = require('underscore')
|
||||
const logger = require('logger-sharelatex')
|
||||
|
||||
logger.info('using standard command runner')
|
||||
|
@ -33,6 +34,8 @@ module.exports = CommandRunner = {
|
|||
let key, value
|
||||
if (callback == null) {
|
||||
callback = function(error) {}
|
||||
} else {
|
||||
callback = _.once(callback)
|
||||
}
|
||||
command = Array.from(command).map(arg =>
|
||||
arg.toString().replace('$COMPILE_DIR', directory)
|
||||
|
|
Loading…
Reference in a new issue