'use strict';

var _stringify = require('babel-runtime/core-js/json/stringify');

var _stringify2 = _interopRequireDefault(_stringify);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Command = require('ronin').Command;
var debug = require('debug');
var log = debug('cli:config');
log.error = debug('cli:config:error');
var utils = require('../../utils');

module.exports = Command.extend({
  desc: 'Outputs the content of the config file',

  options: {},

  run: function run() {
    utils.getIPFS(function (err, ipfs) {
      if (err) {
        throw err;
      }
      ipfs.config.show(function (err, config) {
        if (err) {
          throw err;
        }

        console.log((0, _stringify2.default)(config, null, 4));
      });
    });
  }
});