'use strict';

(function () {

  var chalk = require('chalk');
  var fs = require('fs');

  var path = require('../../utils/path.js');

  var publish = require('./utils/publish.js');

  module.exports = function (options) {

    options.publish = true;

    var dirname = process.cwd();

    var efesconfig = path.join(dirname, '.efesconfig');

    if (!fs.existsSync(efesconfig)) {

      console.log(chalk.red('在当前目录下，未找到 .efesconfig 文件。'));
    } else {

      publish(dirname, options);
    }
  };
})();