gulp-changed does not overwrite files with differing content -


if make 2 files in 2 sibling directories different content:

nvioli$ echo "a" > test1/file.txt nvioli$ echo "b" > test2/file.txt 

then use gulp output first 1 destination folder, , try overwrite second one, filtering gulp-changed using sha1digest comparator:

var changed = require('gulp-changed');  gulp.task('test1', function(){         return gulp.src("test1/file.txt")             .pipe(gulp.dest("dst"))     });  gulp.task('test2', function(){         return gulp.src("test2/file.txt")             .pipe(changed("dst"), {haschanged: changed.comparesha1digest})             .pipe(gulp.dest("dst"))     });  nvioli$ gulp test1 [16:18:01] using gulpfile ~/git/node/gulpfile.js [16:18:01] starting 'test1'... [16:18:01] finished 'test1' after 12 ms nvioli$ gulp test2 [16:18:16] using gulpfile ~/git/node/gulpfile.js [16:18:16] starting 'test2'... [16:18:16] finished 'test2' after 22 ms 

i expect file overwritten since source file in test2 differs in content existing 1 in dst folder, not case:

nvioli$ cat dst/file.txt 

can please clear misunderstanding?

i guess options have part of changed() plugins arguments. (;

change

.pipe(changed("dst"), {haschanged: changed.comparesha1digest}) 

to

.pipe(changed("dst", {haschanged: changed.comparesha1digest})) 

Popular posts from this blog