curist / grunt-bower

grunt task to copy bower installed packages to other folder(s)
MIT License
93 stars 27 forks source link

Changed path separator in `src_paths` when copying multiple files #21

Closed artch closed 10 years ago

artch commented 10 years ago

Bower components may have file paths in main field in different formats, including \ and / path separators in different cases. We can't always rely just on path.sep when splitting the file name prior to copying. Broken use case: with current version of grunt-bower copying of Twitter Bootstrap in Windows environment doesn't work, such an error is thrown:

Fail to copy C:/Home/edumoko/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf for bootstrap!

Changing the path separator to more common regexp rather than path.sep solves the problem.

curist commented 10 years ago

I thought path.sep should be handling this for us...

artch commented 10 years ago

path.sep indicates which one is used in OS the script is running on. But main field of the particular component contains separators in that format which was chosen by the component's author, it is set by him manually in bower.json config. And therefore it can be in any format, or even in mixed format.

Thanks for merging.

curist commented 10 years ago

That makes sense, havn't thought about it before. npm package published. Thank you!

artch commented 10 years ago

Wow, too fast... I am preparing another PR with one more config feature at the moment. :)

curist commented 10 years ago

Keep them coming!

2014-04-09 23:08 GMT+08:00 Artem Chivchalov notifications@github.com:

Wow, too fast... I am preparing another PR with one more config feature at the moment. :)

Reply to this email directly or view it on GitHubhttps://github.com/curist/grunt-bower/pull/21#issuecomment-39975186 .