Make "original-fs" available as built-in module
This commit is contained in:
parent
4129d45d21
commit
0e7bc6b8ec
1 changed files with 3 additions and 3 deletions
|
@ -9,10 +9,10 @@ return (process, require, asarSource) ->
|
|||
|
||||
# Make graceful-fs work with asar.
|
||||
source = process.binding 'natives'
|
||||
source.originalFs = source.fs
|
||||
source.fs = """
|
||||
source['original-fs'] = source.fs
|
||||
source['fs'] = """
|
||||
var src = '(function (exports, require, module, __filename, __dirname) { ' +
|
||||
process.binding('natives').originalFs +
|
||||
process.binding('natives')['original-fs'] +
|
||||
' });';
|
||||
var vm = require('vm');
|
||||
var fn = vm.runInThisContext(src, { filename: 'fs.js' });
|
||||
|
|
Loading…
Reference in a new issue