code: function expandGlobs(main, cwd) {
    if (!main) { return; }
    // expand each glob in main (coerce it to array first)
    var globs = [].concat(main).map(function(pattern) {
      return glob.sync(pattern, {cwd: cwd});
    });
    // flatten globs to single array
    return [].concat.apply([], globs);
  }
docs: expands `main` block (string or array of strings) with given cwd path