-
Notifications
You must be signed in to change notification settings - Fork 87
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
replace corrupts binary files #6
Comments
You could filter binary files with gulp-filter. |
That's correct and I do that, but I still consider this a bug (gulp-replace should not corrupt files!) |
👍 for this - gulp-filter should only attempt to filter plain-text files, not binaries. |
@grahamb, you can use gulp-filter to stop gulp-replace from entering binary files. Did that approach not work for you? |
It does, but unless I'm mis-understanding how gulp-filter works, I have to filter by a glob (e.g. a filename), not file name. So, right now I've got I'd love to be disabused of this notion if I'm wrong. |
It's worth noting that ant (which hilariously is what I'm in the process of converting from) also has the same problem; if you use the ant copy task with a filter (ant-speak for replacing strings in a file with values from a java .properties file) it also corrupts the binaries. You have to do similar acrobatics (copy the files you want to filter first, excluding things with certain extensions, then copy the rest, without using a filter). I was hoping we'd advanced a bit more beyond that in the intervening 14 years 😉 |
I believe that it should be possible to embed something like this: https://github.com/bevry/istextorbinary ? |
the @tcoopman approach could do the trick, but, it should be behind an option since it could slows down the plugin. |
When gulp-replace runs on binary files, it corrupts them. gulp-replace should ignore binary files.
The text was updated successfully, but these errors were encountered: