1 | 'use strict';
|
2 |
|
3 | const amphoraFs = require('amphora-fs'),
|
4 | CONFIG_FILENAME = 'claycli.config';
|
5 | var CONFIG_FILE = getConfigFile();
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | function getConfigFile() {
|
14 | return amphoraFs.tryRequire(`${process.cwd()}/${CONFIG_FILENAME}`);
|
15 | }
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | function getConfigValue(key) {
|
24 | if (!CONFIG_FILE) {
|
25 | return undefined;
|
26 | }
|
27 |
|
28 | return CONFIG_FILE[key];
|
29 | }
|
30 |
|
31 | module.exports.getConfigValue = getConfigValue;
|
32 |
|
33 |
|
34 | module.exports.getConfigFile = getConfigFile;
|
35 | module.exports.setConfigFile = val => CONFIG_FILE = val;
|