mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 12:41:42 +00:00
use a separate function for hidden file check
This commit is contained in:
parent
ef0db811e1
commit
a7cb7e6e4c
1 changed files with 4 additions and 1 deletions
|
@ -64,7 +64,7 @@ module.exports = OutputCacheManager =
|
||||||
results = []
|
results = []
|
||||||
async.mapSeries outputFiles, (file, cb) ->
|
async.mapSeries outputFiles, (file, cb) ->
|
||||||
# don't send dot files as output, express doesn't serve them
|
# don't send dot files as output, express doesn't serve them
|
||||||
if file?.path?.match(/^\.|\/./)
|
if OutputCacheManager._fileIsHidden(file.path)
|
||||||
logger.warn compileDir: compileDir, path: file.path, "ignoring dotfile in output"
|
logger.warn compileDir: compileDir, path: file.path, "ignoring dotfile in output"
|
||||||
return cb()
|
return cb()
|
||||||
# copy other files into cache directory if valid
|
# copy other files into cache directory if valid
|
||||||
|
@ -149,6 +149,9 @@ module.exports = OutputCacheManager =
|
||||||
removeDir dir, cb
|
removeDir dir, cb
|
||||||
, callback
|
, callback
|
||||||
|
|
||||||
|
_fileIsHidden: (path) ->
|
||||||
|
return path?.match(/^\.|\/./)?
|
||||||
|
|
||||||
_checkFileIsSafe: (src, callback = (error, isSafe) ->) ->
|
_checkFileIsSafe: (src, callback = (error, isSafe) ->) ->
|
||||||
# check if we have a valid file to copy into the cache
|
# check if we have a valid file to copy into the cache
|
||||||
fs.stat src, (err, stats) ->
|
fs.stat src, (err, stats) ->
|
||||||
|
|
Loading…
Reference in a new issue