From a15dd33574240843702792042ca2acd77967f4e5 Mon Sep 17 00:00:00 2001 From: Christian Zeller Date: Mon, 12 Dec 2011 10:37:47 +0100 Subject: [PATCH] Improved Windows path support in lessc --- bin/lessc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/bin/lessc b/bin/lessc index 31aee333..5bb974ae 100755 --- a/bin/lessc +++ b/bin/lessc @@ -2,7 +2,8 @@ var path = require('path'), fs = require('fs'), - sys = require('util'); + sys = require('util'), + os = require('os'); var less = require('../lib/less'); var args = process.argv.slice(1); @@ -53,12 +54,10 @@ args = args.filter(function (arg) { options.color = false; break; case 'include-path': - options.paths = match[2].split(':') + options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':') .map(function(p) { - if (p && p[0] == '/') { - return path.join(path.dirname(input), p); - } else if (p) { - return path.join(process.cwd(), p); + if (p) { + return path.resolve(process.cwd(), p); } }); break; @@ -69,12 +68,12 @@ args = args.filter(function (arg) { }); var input = args[1]; -if (input && input[0] != '/' && input != '-' && input[1] != ':') { - input = path.join(process.cwd(), input); +if (input && input != '-') { + input = path.resolve(process.cwd(), input); } var output = args[2]; -if (output && output[0] != '/' && input[1] != ':') { - output = path.join(process.cwd(), output); +if (output) { + output = path.resolve(process.cwd(), output); } var css, fd, tree;