Created
November 12, 2011 05:49
-
-
Save unknownbrackets/1360110 to your computer and use it in GitHub Desktop.
less/less.js#447 - Support absolute paths on Windows.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 8cae7442f0e1e5c89b732062417128bffcf7cfe2 Mon Sep 17 00:00:00 2001 | |
From: Unknown W. Brackets <checkins@unknownbrackets.org> | |
Date: Fri, 11 Nov 2011 21:48:21 -0800 | |
Subject: [PATCH] Support relative paths on Windows - issue 447. | |
--- | |
bin/lessc | 14 ++++++-------- | |
1 files changed, 6 insertions(+), 8 deletions(-) | |
diff --git a/bin/lessc b/bin/lessc | |
index e19775c..c08d458 100755 | |
--- a/bin/lessc | |
+++ b/bin/lessc | |
@@ -54,10 +54,8 @@ args = args.filter(function (arg) { | |
case 'include-path': | |
options.paths = match[2].split(':') | |
.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(path.dirname(input), p); | |
} | |
}); | |
break; | |
@@ -68,12 +66,12 @@ args = args.filter(function (arg) { | |
}); | |
var input = args[1]; | |
-if (input && input[0] != '/' && input != '-') { | |
- input = path.join(process.cwd(), input); | |
+if (input && input != '-') { | |
+ input = path.resolve(process.cwd(), input); | |
} | |
var output = args[2]; | |
-if (output && output[0] != '/') { | |
- output = path.join(process.cwd(), output); | |
+if (output) { | |
+ output = path.resolve(process.cwd(), output); | |
} | |
var css, fd, tree; | |
-- | |
1.7.3.1.msysgit.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment