Update internalModuleReadFile to support unpacked asar files
Add tests for reading unpacked files using both fs.readFileSync and internalModuleReadFile
This commit is contained in:
parent
339496a361
commit
f51103f44a
2 changed files with 23 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue