forked from slightlytyler/bluprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadConfig.js
35 lines (26 loc) · 793 Bytes
/
readConfig.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = readConfig;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _fs = require('fs');
var _fs2 = _interopRequireDefault(_fs);
// Example
//
// {
// "rootDirectory": "dummy/app",
// "podsDirectory": "pods",
// "blueprintsDirectory": "dummy/pods"
// }
function readConfig(callback) {
_fs2['default'].readFile('./.bluprintconfig', 'utf8', function (err, data) {
if (err) throw err; // we'll not consider error handling for now
var options = Object.assign({
"rootDirectory": "app",
"blueprintsDirectory": "blueprints"
}, JSON.parse(data));
callback(options);
});
}
module.exports = exports['default'];