cgross / gulp-dom-src

Create a gulp stream from script, link, or any set of tags in an HTML file.
MIT License
41 stars 8 forks source link

Missing positive glob #5

Open TCB13 opened 7 years ago

TCB13 commented 7 years ago

I'm getting the following error:

[12:57:02] Error: Missing positive glob

Guess there was some BC on gulp or a dependency causing this? Thank you.

trisys3 commented 7 years ago

This usually happens when no files are given to the stream. It's a stupid rule in my opinion, but there you go.

linusok commented 6 years ago

@trisys3

yes, i also find it. this error comes when we support a tag selector not exist in target html file.

for example: gulp.task('test',function(){ console.log('test'); return gulp.src(‘./app/xx.html’,function(err,files){ files.map(function(entry){ console.log(entry); var fileName = path.basename(entry,".html"); var cwd=process.cwd(); var relativePath = path.relative(cwd,entry); var fullPath=path.join(cwd,relativePath); if(!relativePath) return; //if target html file does not have the selector 'img',it will come a error 'missing positive glob'.it is bad exactly when processing the batch html files. it is also a faulty that not support the physical path var ret = domSrc({file:relativePath,selector:'img',attribute:'src'}); ret.pipe(gulp.dest('dist/images'));
}) }) });