-
Notifications
You must be signed in to change notification settings - Fork 35
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
It would be nice to have the source and destination filename available to the "to" function #2
Comments
Hi Stuart, thanks for your suggestion. It's a good idea, I'll try to get this for the next update. I don't believe there's a way to achieve this at present, without a refactor to the plugin itself. One factor in the potential solution is that the number of parameters in the callback is rather high: matchedWord, index, fullText, regexMatches, pathToSource, pathToDestination, it might be best to have a single object returned, with each of these properties hanging off it. It would also be more extensible in future. It's just not backwards compatible. Will let you know when it lands. Cheers, Jonathan |
Hi Jonathan, is there any update on this issue? Accessing the src and dst in the "to" function would be great for my current issue. I understand that this will be a breaking change, maybe an script to upgrade the gruntfile would reduce the pain. |
Based on the fork from #7 I added awareness for the "src" and "dest" via snostorm@d49925b I wasn't confident to post it yet as a pull request as the tests weren't passing for me on the base #7 commits I started with. |
Hi guys, thanks for the comments. I can see how this would be helpful. I had a go at implementing this after my previous comment. Unfortunately, it required such a fundamental rewrite that it would have forced a different approach, and a rewrite of the test suite. I'm still open to the idea of getting this into a future realise, but I haven't immediate plans to add this new feature. I hope you might be able to find a work around in the meantime. If someone however is able to implement the new functionality, and pass the current test suite, then I will of course consider accepting a pull request. Many thanks, Jonathan |
yoniholmes, any news about approving the pull request? |
Hi @ebaranov. Based on your recent request, I've had a go a merging the pull request but found the merge request didn't pass the unit tests. If someone can have a go a updating the pull request so that it passes all the tests, then I'll be happy to merge this in. I expect I won't look at this until someone sends the request though, as unfortunately this isn't a feature I need myself. Many thanks & sorry for the delay in getting back to you. Cheers, Jonathan |
Thanks @yoniholmes, I think I will have a time to check it this week. |
So, what's news? |
+1, I need this feature to solve my current issue where I have to apply different operations based on the source file matched by the regex. I'll use seanzarrin's "passSourceFile" branch for now. |
Same problem here. This thread is more than 2 years old, and this is still no implemented. |
I'd like to do something like:
Maybe I'm missing something and this is available through something like
grunt.task
, but the closest I've found isgrunt.task.current.file.src
which gives me the unexpanded path (something like['**/*.js']
).The text was updated successfully, but these errors were encountered: