code: function wrapRequireClient (work, state, connect) {
    return function () {
      var self = this;
      var args = Array.prototype.slice.call(arguments);
  
      if (!state.client) {
        debug("no client: connect before work");
        return config.list().then(connect).then(function () {
          return work.apply(self, [state.client].concat(args));
        });
      } else {
        // Already connected: work!
        return work.apply(self, [state.client].concat(args));
      }
    };
  }
docs: "work" is called only if github client is connected, otherwise try to authenticate and call work Function(…, cb) → Function(…, cb)