Initial commit

This commit is contained in:
Patrick Marsceill
2017-03-09 13:16:08 -05:00
commit b7b0d0d7bf
4147 changed files with 401224 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
/* @flow */
"use strict"
const configurationError = require("./configurationError")
const resolveFrom = require("resolve-from")
module.exports = function (basedir/*: string*/, lookup/*: string*/)/*: string*/ {
// First try to resolve from the provided directory,
// then try to resolve from process.cwd.
let path = resolveFrom(basedir, lookup)
if (!path) {
path = resolveFrom(process.cwd(), lookup)
}
if (!path) {
throw configurationError(`Could not find "${lookup}". Do you need a \`configBasedir\`?`)
}
return path
}