Numbers Probably Matter

    gulp-repository-watch

    0.0.4 • Public • Published

    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

    Option Default Description
    poll 1000 (1s) How often gulp-repository-watch polls the repository for changes
    initialPoll 1000 (1s) Wrap up time for gulp-repository-watch
    head null The initial Git HEAD commit revision value
    gitHead git ls-remote $REPO HEAD -n 1 The command to use to retrieve the current Git HEAD
    gitPull git pull The command to use to instruct Git to pull in changes

    Events

    Events for subscription:

    Event Description
    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:

    Event Description
    stop Will stop polling Git repository

    Keywords

    none

    Install

    npm i gulp-repository-watch

    DownloadsWeekly Downloads

    2

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • bogdannechyporenko