Skip to content

Commit

Permalink
Merge pull request jdan#63 from Bartvds/feature/windows
Browse files Browse the repository at this point in the history
fixed path handling for windows
  • Loading branch information
jdan committed Nov 18, 2013
2 parents f0d333e + 2ffa391 commit 52c4111
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var normalizePath;
* Root directory so that asset loaders know where to look
* @constant {string}
*/
var ROOT_DIR = path.normalize(__dirname + '/../');
var ROOT_DIR = path.resolve(__dirname, '..');


/**
Expand Down Expand Up @@ -70,7 +70,7 @@ function load(map, external) {
if (!map[key]) continue;

filename = map[key];
if (!external) filename = ROOT_DIR + filename;
if (!external) filename = path.resolve(ROOT_DIR, filename);

promises.push(loadSingle(filename)
.then((function (_key) {
Expand Down Expand Up @@ -243,8 +243,9 @@ module.exports = function (inputPath) {
normalizePath = function (pathname) {
if (pathname[0] == '~') pathname = pathname.replace('~', getUserHome());
if (pathname[0] == '/') return pathname;
if (path.resolve(pathname) == pathname) return pathname;

return path.normalize(path.dirname(inputPath) + '/' + pathname);
return path.resolve(path.dirname(inputPath), pathname);
}

return {
Expand Down

0 comments on commit 52c4111

Please sign in to comment.