Support passing config path via object
This commit is contained in:
parent
7877ffab8a
commit
649fb8f21e
2 changed files with 32 additions and 1 deletions
|
|
@ -13,10 +13,14 @@ import { defaultConfigFile } from './constants'
|
|||
import defaultConfig from '../stubs/defaultConfig.stub.js'
|
||||
|
||||
function resolveConfigPath(filePath) {
|
||||
if (_.isObject(filePath)) {
|
||||
if (_.isObject(filePath) && !_.has(filePath, 'config')) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
if (_.isObject(filePath) && _.has(filePath, 'config')) {
|
||||
return path.resolve(filePath.config)
|
||||
}
|
||||
|
||||
if (!_.isUndefined(filePath)) {
|
||||
return path.resolve(filePath)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue