const walk = require('walk')
const path = require('path')
const readFile = require('fs-readfile-promise')

function read ({ config, logger }) {
  const filepath = path.resolve(config.source)

  return new Promise((resolve, reject) => {
    let result = {}
    walk.walk(filepath)
      .on('file', async function (root, stat, next) {
        const fullPath = path.join(root, stat.name)
        const relativePath = path.relative(config.source, fullPath)
        const data = await dataTransformer(fullPath, stat)
        result[relativePath] = data
        logger.debug('read %s', fullPath)
        next()
      })
      .on('end', () => {
        resolve(result)
      })
      .on('errors', (root, statsArr, next) => {
        const errors = statsArr.map(stat => stat.error)
        reject(errors)
      })
  })
}

async function dataTransformer (filepath, stats) {
  const contents = await readOneFile(filepath)
  return {
    path: filepath,
    contents,
    stats
  }
}

function readOneFile (path) {
  return readFile(path)
}

module.exports = read

@@ -439,32 +439,91 @@
 urce, fullPath)%0A
+        if (!isExcluded(relativePath, config.exclude)) %7B%0A  
         const da
@@ -573,16 +573,18 @@
         
+ 
+ 
 result%5Br
@@ -603,16 +603,18 @@
  = data%0A
+  
         
@@ -639,32 +639,42 @@
  %25s', fullPath)%0A
+        %7D%0A
         next()%0A 
@@ -1100,16 +1100,123 @@
 ath)%0A%7D%0A%0A
+function isExcluded (path, exclude) %7B%0A  return exclude.some(str =%3E %7B%0A    return path.includes(str)%0A  %7D)%0A%7D%0A%0A
 module.e

fix exclusion behavior