gulp-gitmodified

A plugin for Gulp to get an object stream of modified files on git.

npm install gulp-gitmodified
8 downloads in the last week
13 downloads in the last month

gulp-gitmodified

NPM version Build Status Dependency Status

gitmodified plugin for gulp

Usage

A plugin for Gulp to get an object stream of git status files on git (e.g. modified, deleted, untracked, etc).

First, install gulp-gitmodified as a development dependency:

npm install --save-dev gulp-gitmodified

Then, add it to your gulpfile.js:

var gitmodified = require("gulp-gitmodified");

var files = gulp.src("./src/*.ext")
    .pipe(gitmodified('modified'))

files.on('data', function (file) {
  console.log("Modified file:", file);
});

API

gitmodified(statusMode)

statusMode

Type: String
Default: "modified"

What status mode to look for. From git documentation:

' ' = unmodified
M = modified
A = added
D = deleted
R = renamed
C = copied
U = updated but unmerged
?? = untracked
!! = ignored

(and more if in short format (e.g. AM), see Short Format on git status man page)

Can also use string representation. Examples:

// All added files
gulp.src('./**/*')
    .pipe(gitmodified('added'))
// Equal to the one before
gulp.src('./**/*')
    .pipe(gitmodified('A'))
// All deleted files.
gulp.src('./**/*')
    .pipe(gitmodified('deleted'))

License

MIT License

npm loves you