I did something like disso using gulp and gulp-git .
var git = require('gulp-git') // ... other tasks gulp.task('add', function(){ return gulp.src('cdn/**') .pipe(git.add()) })
This add task is then called at the end of everything else. Then I have gulp with a pre-commit hook. It works like a charm.
So, in your case, the full file might look something like this:
var gulp = require('gulp') var $ = require('gulp-load-plugins')() var runSequence = require('run-sequence') gulp.task('default', function () { return runSequence( 'images', 'add' ) }) gulp.task('images', function() { return gulp.src('app/images/**/*') .pipe($.cache($.imagemin({ progressive: true, interlaced: true }))) .pipe(gulp.dest('dist/images')) }) gulp.task('add', function(){ return gulp.src('dist/**') .pipe($.git.add()) })
(Please note that I have not tested it ... I received the image task code from Google.)
Malcolm ocean
source share