'use strict';

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

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var fs__default = /*#__PURE__*/_interopDefault(fs);
var path__default = /*#__PURE__*/_interopDefault(path);

function writeFile(filename, content) {
  const dir = path__default.default.dirname(filename);
  if (!fs__default.default.existsSync(dir)) {
    fs__default.default.mkdirSync(dir, { recursive: true });
  }
  fs__default.default.writeFileSync(filename, content);
}

exports.writeFile = writeFile;
