Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix prefix for windows azure

  • Loading branch information...
commit b5ba0430b012d93367a4f87c304f1d4c8c22941c 1 parent 325584a
Forbes Lindesay authored committed
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/node-modules-paths.js
View
11 lib/node-modules-paths.js
@@ -3,6 +3,12 @@ var path = require('path');
module.exports = function (start, opts) {
var modules = opts.moduleDirectory || 'node_modules';
+ var prefix = '/';
+ if (/^([A-Za-z]:)/.test(start)) {
+ prefix = '';
+ } else if (/^\\\\/.test(start)) {
+ prefix = '\\\\';
+ }
var splitRe = process.platform === 'win32' ? /[\/\\]/ : /\/+/;
var parts = start.split(splitRe);
@@ -13,10 +19,7 @@ module.exports = function (start, opts) {
path.join.apply(path, parts.slice(0, i + 1)),
modules
);
- if (!parts[0].match(/([A-Za-z]:)/)) {
- dir = '/' + dir;
- }
- dirs.push(dir);
+ dirs.push(prefix + dir);
}
return dirs.concat(opts.paths);
}
Please sign in to comment.
Something went wrong with that request. Please try again.