Closed karlvr closed 9 years ago
Thinking a little more deeply, perhaps the intention was to match the string after the final .
. This would match the definition of the path extension in the Cocoa API (with which I'm familiar). Without this logic I have an issue with the jquery file jquery-1.10.2.js
. So perhaps that regex should simply change to: /\.[^.]*$/
I'm happy to update the pull request if you agree!
Best, Karl
Sure, that's a much better idea! I think we need a .length
on the result of path.extname()
.
I've pushed your change to this pull request, in case that makes it easier for you. Thanks for your super quick attention, it's awesome.
Thanks for the enhancement @karlvr. Instead of debugging the Travis failure on Node 0.9, I'm inclined to update the .travis.yml
to only test on Node 0.10. I'll handle that separately.
When using gulp.src, if you set a base dir then you can end up with relative paths that start with a
../
.The existing regex for replacing the file extension doesn't work in this case, even though the * is non-greedy.
We also perhaps need to consider what a file extension is. Is it the last part of the filename, delimited by the
.
or is it everything from the first.
in the filename (not dirname) part of the path?I've assumed the later in this suggested change to the regex. It matches
.
followed by anything not another.
or a/
, and then any other characters to the end of the string. Or just.
at the end of the string.