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