Skip to content

Commit

Permalink
Improved Windows path support in lessc
Browse files Browse the repository at this point in the history
  • Loading branch information
chrizel committed Dec 12, 2011
1 parent 9e48460 commit a15dd33
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions bin/lessc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit a15dd33

Please sign in to comment.