New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 'ext' option for folders containing dot in name #625
Conversation
Tests fail because a dot is encountered before reaching the file when specifying the 'ext' option.
Alternative method to replace the extension. Not sure if this method is buggy is past versions of node.
There's two ways |
@cowboy I am not trying to say that we must chose the last dot, but my issue here is to replace the extension of the filename. Right now it replaces from the first dot in the path, which may be a parent/ancestor folder. For example mapping */.txt to dest/ with
Instead of:
This can have unexpected consequences when mixing the |
Ah, this is a good point. I'll try to fix this for 0.4.0, but it might have to wait for 0.4.1. |
Can you please clone grunt and test this to see if it fixes the issue? |
(This is not published to npm yet, but will be as part of rc7 if there are no outstanding issues) |
One other thing, it should make use of On file path normalization, it file paths doesn't have to be done if Or you could use:
|
Cloned and working on my Mac. Probably won't work on Windows. |
Since the result from |
Ah, okay! Thank you! 👍 |
* The file.expandMapping method "ext" option is now / aware. Closes gh-625.
Problem
grunt.file.expandMapping
doesn't work as expected when it encounters a folder with a dot in its name.Current result:
Expected result:
Proposed solution
Use last occurrence of '.' to replace the extension.