Browse Source

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
Ryan 16 years ago
parent
commit
6acac912dd
  1. 3
      src/node.js

3
src/node.js

@ -81,6 +81,9 @@ node.Module.prototype.load = function (callback) {
self.target.__require = function (path) { return self.newChild(path, {}); };
self.target.__include = function (path) { self.newChild(path, self.target); };
// remove shebang
content = content.replace(/^\#\!.*/, '');
// create wrapper function
var wrapper = "function (__filename) { "+
" var onLoad; "+

Loading…
Cancel
Save