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

  fs.readdir(cwd, function(err, files) {
    if (err) return callback(err);

    var repos = [];
    files.forEach(function(file) {
      if (fs.existsSync(path.join(cwd, file, '.git'))) {
        repos.push(path.join(cwd, file));
      }
    });

    if (repos.length === 0) {
      return callback(new Error('No repositories found'));
    }

    repos.forEach(function(dir) {
      tasks.push(function(done) {
        done(err, git(dir));
      });
    });

    async.series(tasks, function(err, results) {
      callback(err, results);
    });
  });
}
function findRepos(callback) {
  var cwd = process.cwd(),
      tasks = [];

  fs.readdir(cwd, function(err, files) {
    if (err) return callback(err);

    var repos = [];
    files.forEach(function(file) {
      if (fs.existsSync(path.join(cwd, file, '.git'))) {
        repos.push(path.join(cwd, file));
      }
    });

    if (repos.length === 0) {
      return callback(new Error('No repositories found'));
    }

    repos.forEach(function(dir) {
      tasks.push(function(done) {
        done(err, git(dir));
      });
    });

    async.series(tasks, function(err, results) {
      callback(err, results);
    });
  });
}
function findRepos ( callback ) { var cwd = process . cwd ( ) , tasks = [ ] ; fs . readdir ( cwd , function ( err , files ) { if ( err ) return callback ( err ) ; var repos = [ ] ; files . forEach ( function ( file ) { if ( fs . existsSync ( path . join ( cwd , file , '.git' ) ) ) { repos . push ( path . join ( cwd , file ) ) ; } } ) ; if ( repos . length === 0 ) { return callback ( new Error ( 'No repositories found' ) ) ; } repos . forEach ( function ( dir ) { tasks . push ( function ( done ) { done ( err , git ( dir ) ) ; } ) ; } ) ; async . series ( tasks , function ( err , results ) { callback ( err , results ) ; } ) ; } ) ; }
Find and open all git repositories in the CWD.
Find and open all git repositories in the CWD .