Merge pull request #2034 from hongrich/internalModuleReadFile-asar-unpack

Update internalModuleReadFile to support unpacked asar files
This commit is contained in:
Cheng Zhao 2015-06-23 12:38:02 +08:00
commit 4f6e70a75c
2 changed files with 23 additions and 0 deletions

View file

@ -323,6 +323,10 @@ exports.wrapFsWithAsar = (fs) ->
return undefined unless info
return '' if info.size is 0
if info.unpacked
realPath = archive.copyFileOut filePath
return fs.readFileSync realPath, encoding: 'utf8'
buffer = new Buffer(info.size)
fd = archive.getFd()
retrun undefined unless fd >= 0