File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 22
33var path = require ( 'path' ) ,
44 fs = require ( '../lib/less-node/fs' ) ,
5+ os = require ( "os" ) ,
56 errno ,
67 mkdirp ;
78
@@ -152,13 +153,11 @@ function printUsage() {
152153 break ;
153154 case 'include-path' :
154155 if ( checkArgFunc ( arg , match [ 2 ] ) ) {
155- // support for both ; and : path separators
156- // even on windows when using absolute paths with drive letters (eg C:\path:D:\path)
157- var uniqueString = '!@#$%^&*()' ;
158- options . paths = match [ 2 ] . replace ( / \b ( [ a - z ] ) : ( [ \\ \/ ] ) / gi, '$1' + uniqueString + '$2' )
159- . split ( / [ ; : ] / )
156+ // ; supported on windows.
157+ // : supported on windows and linux, excluding a drive letter like C:\ so C:\file:D:\file parses to 2
158+ options . paths = match [ 2 ]
159+ . split ( os . type ( ) . match ( / W i n d o w s / ) ? / : (? ! \\ ) | ; / : ':' )
160160 . map ( function ( p ) {
161- p = p . replace ( uniqueString , ':' ) ;
162161 if ( p ) {
163162 return path . resolve ( process . cwd ( ) , p ) ;
164163 }
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ var lessc_helper = {
2727 console . log ( "" ) ;
2828 console . log ( "options:" ) ;
2929 console . log ( " -h, --help Prints help (this message) and exit." ) ;
30- console . log ( " --include-path=PATHS Sets include paths. Separated by `:'. `;' also supported." ) ;
30+ console . log ( " --include-path=PATHS Sets include paths. Separated by `:'. `;' also supported on windows ." ) ;
3131 console . log ( " -M, --depends Outputs a makefile import dependency list to stdout." ) ;
3232 console . log ( " --no-color Disables colorized output." ) ;
3333 console . log ( " --no-ie-compat Disables IE compatibility checks." ) ;
Original file line number Diff line number Diff line change @@ -266,11 +266,9 @@ function writeFile(filename, content) {
266266 if ( checkArgFunc ( arg , match [ 2 ] ) ) {
267267 // support for both ; and : path separators
268268 // even on windows when using absolute paths with drive letters (eg C:\path:D:\path)
269- var uniqueString = '!@#$%^&*()' ;
270- options . paths = match [ 2 ] . replace ( / \b ( [ a - z ] ) : ( [ \\ \/ ] ) / gi, '$1' + uniqueString + '$2' )
271- . split ( / [ ; : ] / )
269+ options . paths = match [ 2 ]
270+ . split ( os . type ( ) . match ( / W i n d o w s / ) ? / : (? ! \\ ) | ; / : ':' )
272271 . map ( function ( p ) {
273- p = p . replace ( uniqueString , ':' ) ;
274272 if ( p ) {
275273// return path.resolve(process.cwd(), p);
276274 return p ;
You can’t perform that action at this time.
0 commit comments