Merge pull request #3132 from princejwesley/issue-readFileSync
Fix: honor fs.readFileSync contract for empty packed asar file
This commit is contained in:
commit
72e0da069c
1 changed files with 3 additions and 1 deletions
|
@ -263,7 +263,9 @@ exports.wrapFsWithAsar = (fs) ->
|
||||||
|
|
||||||
info = archive.getFileInfo filePath
|
info = archive.getFileInfo filePath
|
||||||
notFoundError asarPath, filePath unless info
|
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
|
if info.unpacked
|
||||||
realPath = archive.copyFileOut filePath
|
realPath = archive.copyFileOut filePath
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue