var path = require('path')
var findup = require('findup-sync')
module.exports = loadBrocfile
function loadBrocfile () {
var brocfile = findup('Brocfile.js', {
nocase: true
})
if (brocfile == null) throw new Error('Brocfile.js not found')
var baseDir = path.dirname(brocfile)
// The chdir should perhaps live somewhere else and not be a side effect of
// this function, or go away entirely
process.chdir(baseDir)
var node = require(brocfile)
return node
}