Permalink
Browse files

Add current file's dir to LESS search paths list

  • Loading branch information...
1 parent b703820 commit acec117bbe1f9e16547bd9bb44bda8e9b3bbee34 @yumike yumike committed Nov 7, 2012
Showing with 13 additions and 2 deletions.
  1. +4 −2 gears_less/compiler.js
  2. +9 −0 gears_less/compiler.py
View
@@ -1,4 +1,5 @@
-var less = require('less'),
+var path = require('path'),
+ less = require('less'),
source = '';
process.stdin.resume();
@@ -9,7 +10,8 @@ process.stdin.on('data', function(chunk) {
});
process.stdin.on('end', function() {
- var parser = new less.Parser();
+ var filename = process.argv[2],
+ parser = new(less.Parser)({paths: [path.dirname(filename)]});
parser.parse(source, function(err, tree) {
if (err) {
less.writeError(err);
View
@@ -7,3 +7,12 @@ class LESSCompiler(ExecCompiler):
result_mimetype = 'text/css'
executable = 'node'
params = [os.path.join(os.path.dirname(__file__), 'compiler.js')]
+
+ def __call__(self, asset):
+ self.asset = asset
+ super(LESSCompiler, self).__call__(asset)
+
+ def get_args(self):
+ args = super(LESSCompiler, self).get_args()
+ args.append(self.asset.absolute_path)
+ return args

0 comments on commit acec117

Please sign in to comment.