var fs = require('fs')

module.exports = function (path, opts) {
  if (!path) throw new Error('Path must be provided')

  return function (err, src) {
    if (!opts) opts = {}
    if (err) throw err

    fs.writeFileSync(path, src, 'utf8');

    if (opts.debug) console.log('File written to ' + path)
  }
}

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

module.exports = function (filepath, opts) {
  if (!filepath) throw new Error('Path must be provided')

  return function (err, src) {
    if (!opts) opts = {}
    if (err) throw err

    fs.writeFileSync(filepath, src, 'utf8');

    if (opts.debug) console.log('File written to ' + path.relative(process.cwd(), filepath))
  }
}

Make logged file path relative
Make logged file path relative