Fix files and path calls in some places

This commit is contained in:
Slava Kim
2014-12-15 19:47:52 -08:00
committed by Sashko Stubailo
parent 8cafda074c
commit 9ed25775fe
2 changed files with 9 additions and 9 deletions

View File

@@ -361,8 +361,8 @@ files.treeHash = function (root, options) {
// it was already created). if it returns false, the item is not a
// directory and we couldn't make it one.
files.mkdir_p = function (dir, mode) {
var p = path.resolve(dir);
var ps = path.normalize(p).split(path.sep);
var p = files.pathResolve(dir);
var ps = files.pathNormalize(p).split(files.pathSep);
var stat = files.statOrNull(p);
if (stat) {
@@ -370,9 +370,12 @@ files.mkdir_p = function (dir, mode) {
}
// doesn't exist. recurse to build parent.
var success = files.mkdir_p(ps.slice(0,-1).join(path.sep), mode);
// Don't use files.pathJoin here because it can strip off the leading slash
// accidentally.
var parentPath = ps.slice(0, -1).join(files.pathSep);
var success = files.mkdir_p(parentPath, mode);
// parent is not a directory.
if (!success) { return false; }
if (! success) { return false; }
var pathIsDirectory = function (path) {
var stat = files.statOrNull(path);
@@ -1289,10 +1292,6 @@ files.pathwatcherWatch = function () {
var pathwatcher = require('meteor-pathwatcher-tweaks');
return pathwatcher.watch.apply(pathwatcher, args);
};
<<<<<<< HEAD
=======
files.convertToStandardPath = convertToStandardPath;
files.convertToOSPath = convertToOSPath;
>>>>>>> Fix path conversions in a lot of places

View File

@@ -341,7 +341,8 @@ var runNpmCommand = function (args, cwd) {
var npmPath;
if (os.platform() === "win32") {
npmPath = files.pathJoin(files.getDevBundle(), "bin", "npm.cmd");
npmPath = files.convertToOSPath(
files.pathJoin(files.getDevBundle(), "bin", "npm.cmd"));
} else {
npmPath = files.pathJoin(files.getDevBundle(), "bin", "npm");
}