1
1
'use strict' ;
2
2
3
+ var path = require ( 'path' ) ;
3
4
var assign = require ( 'object-assign' ) ;
4
5
var through2 = require ( 'through2' ) ;
5
6
var gs = require ( 'glob-stream' ) ;
@@ -13,6 +14,21 @@ var isValidGlob = require('is-valid-glob');
13
14
var getContents = require ( './getContents' ) ;
14
15
var resolveSymlinks = require ( './resolveSymlinks' ) ;
15
16
17
+ function normalizePath ( options ) {
18
+
19
+ function normalize ( globFile , enc , cb ) {
20
+ // TODO: probably move this somewhere
21
+ // Ref https://github.com/gulpjs/vinyl/issues/80
22
+ var normalizedFile = assign ( { } , globFile , {
23
+ path : path . normalize ( globFile . path ) ,
24
+ } ) ;
25
+
26
+ cb ( null , normalizedFile ) ;
27
+ }
28
+
29
+ return through2 . obj ( options , normalize ) ;
30
+ }
31
+
16
32
function createFile ( globFile , enc , cb ) {
17
33
cb ( null , new File ( globFile ) ) ;
18
34
}
@@ -36,6 +52,7 @@ function src(glob, opt) {
36
52
var globStream = gs . create ( glob , options ) ;
37
53
38
54
var outputStream = globStream
55
+ . pipe ( normalizePath ( options ) )
39
56
. pipe ( resolveSymlinks ( options ) )
40
57
. pipe ( through2 . obj ( opt , createFile ) ) ;
41
58
0 commit comments