lib/index.js
function pull() {
  var tasks = [],
      cwd = process.cwd();

  findRepos(function(err, repos) {
    if (err) return console.log(err);
    repos.forEach(function(repo) {
      tasks.push(function(done) {
        repo.status(function(err, status) {
          var name = status.repo.path.replace(cwd + '/', '');
          if (!status.clean) {
            console.log('Skipped '.red + name.bold + ' (not clean)'.grey);
            done();
          }
          else {
            console.log('Pulling '.green + name.bold);
            process.chdir(status.repo.path);
            exec('git fetch', function(err, stdout, stderr) {
              if (err) return done(stderr);
              if (stdout && argv.v) console.log(indent(stdout));
              exec('git rebase', function(err, stdout, stderr) {
                if (err) return done(stderr);
                if (stdout && argv.v) console.log(indent(stdout));
                done(null);
              });
            });
          }
        });
      });
    });

    async.series(tasks, function(err, results) {
      if (err) {
        console.log('Error:'.red);
        console.log(err);
      }
      else {
        console.log('Done!');
      }
    });
  });
}
function pull() {
  var tasks = [],
      cwd = process.cwd();

  findRepos(function(err, repos) {
    if (err) return console.log(err);
    repos.forEach(function(repo) {
      tasks.push(function(done) {
        repo.status(function(err, status) {
          var name = status.repo.path.replace(cwd + '/', '');
          if (!status.clean) {
            console.log('Skipped '.red + name.bold + ' (not clean)'.grey);
            done();
          }
          else {
            console.log('Pulling '.green + name.bold);
            process.chdir(status.repo.path);
            exec('git fetch', function(err, stdout, stderr) {
              if (err) return done(stderr);
              if (stdout && argv.v) console.log(indent(stdout));
              exec('git rebase', function(err, stdout, stderr) {
                if (err) return done(stderr);
                if (stdout && argv.v) console.log(indent(stdout));
                done(null);
              });
            });
          }
        });
      });
    });

    async.series(tasks, function(err, results) {
      if (err) {
        console.log('Error:'.red);
        console.log(err);
      }
      else {
        console.log('Done!');
      }
    });
  });
}
function pull ( ) { var tasks = [ ] , cwd = process . cwd ( ) ; findRepos ( function ( err , repos ) { if ( err ) return console . log ( err ) ; repos . forEach ( function ( repo ) { tasks . push ( function ( done ) { repo . status ( function ( err , status ) { var name = status . repo . path . replace ( cwd + '/' , '' ) ; if ( ! status . clean ) { console . log ( 'Skipped ' . red + name . bold + ' (not clean)' . grey ) ; done ( ) ; } else { console . log ( 'Pulling ' . green + name . bold ) ; process . chdir ( status . repo . path ) ; exec ( 'git fetch' , function ( err , stdout , stderr ) { if ( err ) return done ( stderr ) ; if ( stdout && argv . v ) console . log ( indent ( stdout ) ) ; exec ( 'git rebase' , function ( err , stdout , stderr ) { if ( err ) return done ( stderr ) ; if ( stdout && argv . v ) console . log ( indent ( stdout ) ) ; done ( null ) ; } ) ; } ) ; } } ) ; } ) ; } ) ; async . series ( tasks , function ( err , results ) { if ( err ) { console . log ( 'Error:' . red ) ; console . log ( err ) ; } else { console . log ( 'Done!' ) ; } } ) ; } ) ; }
Pull and rebase all CLEAN git repos in the CWD.
Pull and rebase all CLEAN git repos in the CWD .