   rc.hgetall "communities", (err, hash) ->
     if err or Object.keys(hash) == 0
       ghRepos.getFromOrg {org: "communities"}, (err, repos) ->
+        if err
+          callback err
+          return
         repos = _.filter repos, (repo) -> repo.name != "gitcommunities.com"
         communitiesFetchFuncs = []
         _.each repos, (repo) ->

createGitRepo = (repo, callback) ->
  {name} = repo
  gitty.create name, repo.description, __dirname + "/repos", (err, data) ->
    gitty.add __dirname + "/repos/#{name}", ["LICENSE"], (err, data) ->
      gitty.commit __dirname + "/repos/#{name}", "initial", (err, data) ->
        gitty.remote.add __dirname + "/repos/#{name}", "origin", "https://github.com/communities/#{name}.git", (err, data) ->
          console.log "origin was added", err, data
          gitty.push __dirname + "/repos/#{name}", "origin", "master", (err, data) ->
            callback undefined, data  


passport = require "passport"

fs      = require "fs"
express = require "express"
md      = require "markdown"
async   = require "async"
