Function
readDataSourceConfigFromJSON
(datasourcesDir, dataSourceClass)
Source from the content-addressed store, hash-verified
| 669 | } |
| 670 | |
| 671 | function readDataSourceConfigFromJSON(datasourcesDir, dataSourceClass) { |
| 672 | const datasourceJSONFile = path.join( |
| 673 | datasourcesDir, |
| 674 | exports.dataSourceToJSONFileName(dataSourceClass), |
| 675 | ); |
| 676 | |
| 677 | debug(`Reading datasource config from JSON file ${datasourceJSONFile}`); |
| 678 | try { |
| 679 | return JSON.parse(fs.readFileSync(datasourceJSONFile, 'utf8')); |
| 680 | } catch (err) { |
| 681 | err.message = `Cannot load ${datasourceJSONFile}: ${err.message}`; |
| 682 | throw err; |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | /** |
| 687 | * |
Tested by
no test coverage detected