'use strict';

exports.ifRepoExists = function (repo, cb) {
  repo.exists(function (err, exists) {
    if (err) {
      return cb(err);
    }

    if (exists === false) {
      return cb(new Error('no ipfs repo found'));
    }

    cb();
  });
};