0.0.4 • Published 8 years ago

gulp-repository-watch v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

gulp-repository-watch

Gulp plugin for watching the commit changes in the repository defined as a dependency in bower.json

var gulp = require('gulp');
var repoWatch = require('gulp-repository-watch');

gulp.task('repo-watch', function() {
	repoWatch({
	        repository: 'git@github.com:acierto/gulp-repository-watch.git'
	    })
		.on('check', function() {
			console.log('ping');
		})
		.on('change', function(newHash, oldHash) {
			console.log('Changed from ', oldHash, ' to ', newHash);
		});
});

You can also point to the branch of the repository by specifying it like that:

repoWatch({
    repository: 'git@github.com:acierto/gulp-repository-watch.git#experimental'
    ...

Options

OptionDefaultDescription
poll1000 (1s)How often gulp-repository-watch polls the repository for changes
initialPoll1000 (1s)Wrap up time for gulp-repository-watch
headnullThe initial Git HEAD commit revision value
gitHeadgit ls-remote $REPO HEAD -n 1The command to use to retrieve the current Git HEAD
gitPullgit pullThe command to use to instruct Git to pull in changes

Events

Events for subscription:

EventDescription
check()Triggered when gulp-repository-watch polls Git for changes
change(newHash, oldHash)Triggered when Git has updated from the old hash to a new hash
nochange(hash)Triggered when no Git changes were found

Events for emitting:

EventDescription
stopWill stop polling Git repository