try/catch to prioritise local.config.js

This commit is contained in:
Lachlan Kermode
2020-09-23 18:08:40 +02:00
parent 35f8460eb4
commit 1e2a991708

View File

@@ -1,7 +1,6 @@
import StoreJson from './models/StoreJson'
import fetchers from './lib/Fetcher'
import Controller from './lib/Controller'
import config from './config'
import R from 'ramda'
const isntNull = n => n !== null
@@ -9,6 +8,13 @@ const filterNull = ls => R.filter(isntNull, ls)
const flattenfilterNull = ls => filterNull(R.flatten(ls))
let themFetchers
let config
try {
config = require('./local.config.js').default
} catch (_) {
config = require('./config.js').default
}
export default callback => {
return Promise.resolve().then(() => {
return Object.keys(config).map(fType => {