function exportAndUpdate(srcPath, destBase, flatten, bookPath, projPath) {
  return getCLAATFiles(srcPath)
  .then(function(files) {
    return Promise.all(files.map(function(file) {
      let srcFile = file;
      let srcImgPath = file.replace('index.md', 'img/');
      let destDir = file.replace(srcPath, '').replace('/index.md', '');
      destDir = path.join(destBase, destDir);
      let destFile = path.join(destDir, 'index.md');
      if (flatten === true) {
        destDir = path.resolve(destDir, '..');
        destFile = destFile.replace('/index.md', '.md');
      }
      let destImgPath = path.join(destDir, 'img');
      wfCodeLabHelper.updateCodeLab(srcFile, destFile, bookPath, projPath);
      return wfHelper.promisedRSync(srcImgPath, destImgPath);
    }));
  });
}
Updates files, and copies them to the appropriate directory

@param {string} srcPath The source directory to find the files.
@param {string} destBase The destination to copy to.
@param {Boolean} flatten Whether to flatten the files to one directory.
@param {string} bookPath The location of the book.yaml file
@param {string} projPath The location of the project.yaml file
@return {Promise} The promise that will be resolved on completion.