From 063890b8da874eb191bbcf75732f376c5cc9f4f8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 7 Sep 2009 14:09:18 +0200 Subject: [PATCH] Internally use full paths when loading modules. This completes shebang support begun in 6acac912dd4da0479a0630a8d1b2878ca83b22de. --- src/node.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/node.js b/src/node.js index f6d0a4aa4e..5cab8330ca 100644 --- a/src/node.js +++ b/src/node.js @@ -202,6 +202,15 @@ node.Module.prototype.waitChildrenLoad = function (callback) { }; (function () { + // Make ARGV[0] and ARGV[1] into full paths. + if (ARGV[0].charAt(0) != "/") { + ARGV[0] = node.path.join(node.cwd(), ARGV[0]); + } + + if (ARGV[1].charAt(0) != "/") { + ARGV[1] = node.path.join(node.cwd(), ARGV[1]); + } + // Load the root module--the command line argument. var root_module = new node.Module({ path: node.path.filename(ARGV[1]),