cgross / grunt-dom-munger

Grunt task to read and manipulate HTML with CSS selectors.
MIT License
93 stars 40 forks source link

Convert file path to a string to avoid "Warning: Path must be a string" #44

Closed securityvoid closed 3 years ago

securityvoid commented 7 years ago

If "isPath" is set, I had problems with grunt.file.expand returning an array, which grunt.dirname did not appear to like and threw out the error:

Warning: Path must be a string. Received [ 'index.html' ] Use --force to continue.

Converting the array to a String with toString seems to solve the issue. In addition if there are older versions of grunt/node that aren't having grunt.file.expand pass an array, calling toString() on a String should have no effect. This should make this backwards compatible.

niemyjski commented 3 years ago

This has been fixed in the latest push, thanks for the pr.