<commit_before>var glob = require("glob");
var fs = require("fs");

glob("bower_components/*/src/**/*.{js,purs}", function(err, files) {
  if (err) throw err;<commit_msg>Ensure the 'flattened' directory exists<commit_after>var glob = require("glob");
var fs = require("fs");

try {
  fs.mkdirSync("./flattened");
} catch(e) {
  // ignore the error if it already exists
  if (e.code !== "EEXIST") {
    throw(e);
  }
}

glob("bower_components/*/src/**/*.{js,purs}", function(err, files) {
  if (err) throw err;