mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
use once for callback
This commit is contained in:
parent
e84d6305f3
commit
4169f7fc73
2 changed files with 6 additions and 1 deletions
|
@ -2,6 +2,7 @@ let OutputFileFinder
|
|||
const async = require('async')
|
||||
const fs = require('fs')
|
||||
const Path = require('path')
|
||||
const _ = require('lodash')
|
||||
const { spawn } = require('child_process')
|
||||
const logger = require('logger-sharelatex')
|
||||
|
||||
|
@ -32,7 +33,8 @@ module.exports = OutputFileFinder = {
|
|||
})
|
||||
},
|
||||
|
||||
_getAllFiles(directory, _callback) {
|
||||
_getAllFiles(directory, callback) {
|
||||
callback = _.once(callback)
|
||||
// don't include clsi-specific files/directories in the output list
|
||||
const EXCLUDE_DIRS = [
|
||||
'-name',
|
||||
|
|
|
@ -28,6 +28,9 @@ describe('OutputFileFinder', function () {
|
|||
fs: (this.fs = {}),
|
||||
child_process: { spawn: (this.spawn = sinon.stub()) },
|
||||
'logger-sharelatex': { log: sinon.stub(), warn: sinon.stub() }
|
||||
},
|
||||
globals: {
|
||||
Math // used by lodash
|
||||
}
|
||||
})
|
||||
this.directory = '/test/dir'
|
||||
|
|
Loading…
Reference in a new issue