Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Feb 14, 2018
1 parent 3bf4e58 commit 0614b4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 8 additions & 3 deletions packages/gatsby/src/bootstrap/get-config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ module.exports = async function getConfigFile(
distance: number = 3
) {
const configPath = `${rootDir}/${configName}`
let configModule
try {
return require(configPath)
configModule = require(configPath)
} catch (err) {
const nearMatch = await fs.readdir(rootDir).then(files => files.find(file => {
const nearMatch = await fs.readdir(rootDir).then(files =>
files.find(file => {
const fileName = file.split(rootDir).pop()
return isNearMatch(fileName, configName, distance)
}))
})
)
if (!testRequireError(configPath, err)) {
report.error(`Could not load ${configName}`, err)
process.exit(1)
Expand All @@ -40,4 +43,6 @@ module.exports = async function getConfigFile(
process.exit(1)
}
}

return configModule
}
1 change: 0 additions & 1 deletion packages/gatsby/src/bootstrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const crypto = require(`crypto`)
const del = require(`del`)

const apiRunnerNode = require(`../utils/api-runner-node`)
const testRequireError = require(`../utils/test-require-error`)
const { graphql } = require(`graphql`)
const { store, emitter } = require(`../redux`)
const loadPlugins = require(`./load-plugins`)
Expand Down

0 comments on commit 0614b4b

Please sign in to comment.