2018-03-26 08:20:12 -05:00
|
|
|
|
2019-02-24 17:20:25 -05:00
|
|
|
import _ from 'lodash';
|
2018-03-26 08:20:12 -05:00
|
|
|
import path from 'path';
|
|
|
|
|
2019-09-26 11:22:14 -05:00
|
|
|
import {parseConfigFile} from '../../../../src/lib/utils';
|
2018-01-28 05:38:22 -05:00
|
|
|
|
2019-09-26 11:22:14 -05:00
|
|
|
/**
|
|
|
|
* Override the default.yaml configuration file with any new config provided.
|
|
|
|
*/
|
2019-02-24 17:20:25 -05:00
|
|
|
export default (options, url = 'default.yaml') => {
|
|
|
|
const locationFile = path.join(__dirname, `../config/yaml/${url}`);
|
|
|
|
const config = parseConfigFile(locationFile);
|
2019-09-26 11:22:14 -05:00
|
|
|
|
2019-02-24 17:20:25 -05:00
|
|
|
return _.assign({}, _.cloneDeep(config), options);
|
|
|
|
}
|