mirror of https://github.com/nodejs/node.git
Initial support for shebang.
There are some issues with loading modules from shebang-executed scripts that will still need to be addressed, but this works for simple single script situations.v0.7.4-release
parent
11df252cb9
commit
6acac912dd
|
@ -81,6 +81,9 @@ node.Module.prototype.load = function (callback) {
|
||||||
self.target.__require = function (path) { return self.newChild(path, {}); };
|
self.target.__require = function (path) { return self.newChild(path, {}); };
|
||||||
self.target.__include = function (path) { self.newChild(path, self.target); };
|
self.target.__include = function (path) { self.newChild(path, self.target); };
|
||||||
|
|
||||||
|
// remove shebang
|
||||||
|
content = content.replace(/^\#\!.*/, '');
|
||||||
|
|
||||||
// create wrapper function
|
// create wrapper function
|
||||||
var wrapper = "function (__filename) { "+
|
var wrapper = "function (__filename) { "+
|
||||||
" var onLoad; "+
|
" var onLoad; "+
|
||||||
|
|
Loading…
Reference in New Issue