Merge pull request #132 from das7pad/hotfix-double-call
[LocalCommandRunner] run: block a double call of the callback
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
let CommandRunner
|
let CommandRunner
|
||||||
const { spawn } = require('child_process')
|
const { spawn } = require('child_process')
|
||||||
|
const _ = require('underscore')
|
||||||
const logger = require('logger-sharelatex')
|
const logger = require('logger-sharelatex')
|
||||||
|
|
||||||
logger.info('using standard command runner')
|
logger.info('using standard command runner')
|
||||||
@@ -33,6 +34,8 @@ module.exports = CommandRunner = {
|
|||||||
let key, value
|
let key, value
|
||||||
if (callback == null) {
|
if (callback == null) {
|
||||||
callback = function(error) {}
|
callback = function(error) {}
|
||||||
|
} else {
|
||||||
|
callback = _.once(callback)
|
||||||
}
|
}
|
||||||
command = Array.from(command).map(arg =>
|
command = Array.from(command).map(arg =>
|
||||||
arg.toString().replace('$COMPILE_DIR', directory)
|
arg.toString().replace('$COMPILE_DIR', directory)
|
||||||
|
|||||||
Reference in New Issue
Block a user