VR1256
VR1256

Reputation: 1450

Gulp TFS checkout for only modified files in dest folder when src folder files are changed

I am trying to checkout files from dest folder when I change files in the src folder. Currently when I use tfs-gulp-checkout plugin it is checkout all the files, but I am trying to checkout only modified files in src folder to that of dest folder:

const tfs = require('gulp-tfs-checkout');
const gulpWatch = require('gulp-watch');

gulp.task('checkoutcss', function () {
    return gulp.src(['dest/Content/**/*.css'])
         .pipe(tfs())
});

gulp.task('build-less',["checkoutcss"], () => {
   return gulp.src('Content/**/*.less')
         .pipe(less())
         .pipe(gulp.dest('dest/Content'))
});

gulp.task('watch', () => {
    gulpWatch(["Content/**/*.less"], () => {
        runSequence('build-less', 'bs-reload');
    });
});

How can I check out only modified files in dest folder, for example only one less file is modified above code is checking out all the CSS files in the dest folder which I don't want to.

Here is another solution I found, but couldn't figure out how to use it with gulp task:

https://gist.github.com/loktar00/345d071d5086fec957ab

Upvotes: 1

Views: 635

Answers (0)

Related Questions