File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 2
2
3
3
var path = require ( 'path' ) ,
4
4
fs = require ( 'fs' ) ,
5
- sys = require ( 'util' ) ;
5
+ sys = require ( 'util' ) ,
6
+ os = require ( 'os' ) ;
6
7
7
8
var less = require ( '../lib/less' ) ;
8
9
var args = process . argv . slice ( 1 ) ;
@@ -53,12 +54,10 @@ args = args.filter(function (arg) {
53
54
options . color = false ;
54
55
break ;
55
56
case 'include-path' :
56
- options . paths = match [ 2 ] . split ( ':' )
57
+ options . paths = match [ 2 ] . split ( os . type ( ) . match ( / W i n d o w s / ) ? ';' : ':' )
57
58
. map ( function ( p ) {
58
- if ( p && p [ 0 ] == '/' ) {
59
- return path . join ( path . dirname ( input ) , p ) ;
60
- } else if ( p ) {
61
- return path . join ( process . cwd ( ) , p ) ;
59
+ if ( p ) {
60
+ return path . resolve ( process . cwd ( ) , p ) ;
62
61
}
63
62
} ) ;
64
63
break ;
@@ -69,12 +68,12 @@ args = args.filter(function (arg) {
69
68
} ) ;
70
69
71
70
var input = args [ 1 ] ;
72
- if ( input && input [ 0 ] != '/' && input != '-' && input [ 1 ] != ': ') {
73
- input = path . join ( process . cwd ( ) , input ) ;
71
+ if ( input && input != '- ' ) {
72
+ input = path . resolve ( process . cwd ( ) , input ) ;
74
73
}
75
74
var output = args [ 2 ] ;
76
- if ( output && output [ 0 ] != '/' && input [ 1 ] != ':' ) {
77
- output = path . join ( process . cwd ( ) , output ) ;
75
+ if ( output ) {
76
+ output = path . resolve ( process . cwd ( ) , output ) ;
78
77
}
79
78
80
79
var css , fd , tree ;
You can’t perform that action at this time.
0 commit comments