Skip to content
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

Add filepath to replacement callback #65

Closed
wants to merge 1 commit into from
Closed

Conversation

ianstarz
Copy link

This adds access to the file path within the replacement hook for replace operations that are based on conventional directory structures

@oleggromov
Copy link
Contributor

👍 for this feature, it is useful.

@lazd
Copy link
Owner

lazd commented Feb 28, 2016

This PR does not seem to support regex search and replace for this feature. If you can find a way to support that (using replace.bind() maybe?) then I think we can go forward with it, but we need feature parity between normal search/replace and regex for this to go in.

Also, docs and tests please! :)

@oleggromov
Copy link
Contributor

Lazd, the replacement function can also be called from within the replacestream library call, thus, for consistency, the fix should involve the streamed input too, doesn't it? The problem is in creating inconsistency on the other side: replacestream calls the replace function with a different bunch of arguments (just like String.prototype.replace calls its arguments of type function; details can be found in readme) while gulp-replace is going to introduce its own format.

How do you think should this issue be solved?

@oleggromov oleggromov mentioned this pull request Mar 4, 2016
@oleggromov
Copy link
Contributor

I made a correct and consistent for all use cases fix in a sibling PR: #67
Please take a look.

@ianstarz
Copy link
Author

Thanks @oleggromov, closing in favor of #67

@ianstarz ianstarz closed this Mar 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants