Patch files using unified diffs as part of a gulp build process.
Install gulp-apply-patch
using npm
as a development dependency:
npm install --save-dev gulp-apply-patch
In your gulpfile.js
use it in a task as follows.
var applyPatch = require('gulp-apply-patch');
gulp.task('patch', function() {
gulp.src('vnd/**/*.js')
.pipe(patch("patches/*.patch"))
.pipe(gulp.dest('out'));
});
Take one or more unified diffs and applies those in order to the piped files, when ever the relative path of the piped file matches the path of the diff.
Type: String
| Array
Either a path string or glob string that will be used to load patch files from disk, or an array of raw unified diffs.
Type: Object
Type: Boolean
Default: false
Replace \r\n
with \n
for Windows compatibility.