const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');

module.exports = function (config, callback) {  
  const url = path.resolve(process.cwd(), config);

  try {  
    return yaml.safeLoad(fs.readFileSync(url, 'utf8'));
  } catch (e) {
    throw new Error('Cannot parse configuration file. Please make sure your Swanky configuration file exists.');
  }
};