Permalink
Browse files

switched to path.join() so noderc will work on windows

  • Loading branch information...
1 parent e1c8ad4 commit c2ad82850fec6a00bd7f97b444360fe3cd9b7f3e @regality committed Apr 26, 2012
Showing with 10 additions and 7 deletions.
  1. +10 −7 src/node.js
View
@@ -109,6 +109,7 @@
} else {
var Module = NativeModule.require('module');
+ var path = NativeModule.require('path');
// If -i or --interactive were passed, or stdin is a TTY.
if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
@@ -125,13 +126,15 @@
}
var home = process.env.HOME;
- var pwd = NativeModule.require('path').resolve('.');
-
- var noderc = home + "/.noderc.js";
- var pwdrc = pwd + "/.noderc.js";
-
- var homeContext = home ? loadContext(noderc) : {};
- var pwdContext = pwd ? loadContext(pwdrc) : {};
+ var pwd = path.resolve('.');
+ if (home) {
+ var noderc = path.join(home, ".noderc.js");
+ var homeContext = loadContext(noderc);
+ }
+ if (pwd) {
+ var pwdrc = path.join(pwd, ".noderc.js");
+ var pwdContext = loadContext(pwdrc);
+ }
var repl = Module.requireRepl().start(opts);
repl.on('exit', function() {

0 comments on commit c2ad828

Please sign in to comment.