Skip to content

Commit

Permalink
Look in the current directory last when looking for imports. Fixes #1083
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeapage committed Dec 22, 2012
1 parent eb7242d commit b9061ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/less/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ less.Parser.importer = function (file, paths, callback, env) {

// TODO: Undo this at some point,
// or use different approach.
var paths = [].concat(paths); // Avoid passing paths by reference down the import tree...
paths.unshift('.'); // ...which results on a lot of repeated '.' paths.
var paths = [].concat(paths);
paths.push('.');

for (var i = 0; i < paths.length; i++) {
try {
Expand All @@ -111,6 +111,8 @@ less.Parser.importer = function (file, paths, callback, env) {
pathname = null;
}
}

paths = paths.slice(0, paths.length - 1);

if (!pathname) {
if (typeof(env.errback) === "function") {
Expand Down

0 comments on commit b9061ac

Please sign in to comment.