Merge pull request #3132 from princejwesley/issue-readFileSync

Fix: honor fs.readFileSync contract for empty packed asar file
This commit is contained in:
Cheng Zhao 2015-10-19 16:59:47 +08:00
commit 72e0da069c

View file

@ -263,7 +263,9 @@ exports.wrapFsWithAsar = (fs) ->
info = archive.getFileInfo filePath
notFoundError asarPath, filePath unless info
return new Buffer(0) if info.size is 0
if info.size is 0
return if options then '' else new Buffer(0)
if info.unpacked
realPath = archive.copyFileOut filePath