1 | const path = require('path');
|
2 | const getCwd = require('./get-cwd');
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | module.exports = (portion = false) => {
|
12 | if (portion === 'client') {
|
13 | return typeof process.env
|
14 | .KOOT_PROJECT_CONFIG_PORTION_CLIENT_PATHNAME === 'string'
|
15 | ? process.env.KOOT_PROJECT_CONFIG_PORTION_CLIENT_PATHNAME
|
16 | : path.resolve(getCwd(), 'koot.js');
|
17 | }
|
18 | if (portion === 'client-other') {
|
19 | return typeof process.env
|
20 | .KOOT_PROJECT_CONFIG_PORTION_OTHER_CLIENT_PATHNAME === 'string'
|
21 | ? process.env.KOOT_PROJECT_CONFIG_PORTION_OTHER_CLIENT_PATHNAME
|
22 | : path.resolve(getCwd(), 'koot.js');
|
23 | }
|
24 | if (portion) {
|
25 | return typeof process.env
|
26 | .KOOT_PROJECT_CONFIG_PORTION_SERVER_PATHNAME === 'string'
|
27 | ? process.env.KOOT_PROJECT_CONFIG_PORTION_SERVER_PATHNAME
|
28 | : path.resolve(getCwd(), 'koot.js');
|
29 | }
|
30 | return typeof process.env.KOOT_PROJECT_CONFIG_FULL_PATHNAME === 'string'
|
31 | ? process.env.KOOT_PROJECT_CONFIG_FULL_PATHNAME
|
32 | : path.resolve(getCwd(), 'koot.js');
|
33 | };
|