Compare View
Commits (3)
Changes
Showing 2 changed files Inline Diff
config-from-main.js
1 | "use strict"; | 1 | "use strict"; |
2 | 2 | ||
3 | const fs = require('fs'); | 3 | const fs = require('fs'); |
4 | const os = require('os'); | 4 | const os = require('os'); |
5 | 5 | ||
6 | const candindates = [ | 6 | const candindates = [ |
7 | '/etc/komodo/config.js', | 7 | '/etc/komodo/config.js', |
8 | os.homedir() + '/main/config.json', | 8 | os.homedir() + '/main/config.json', |
9 | process.cwd() + '/../../main/config.json', | 9 | process.cwd() + '/../../main/config.json', |
10 | os.homedir() + '/Projects/tektrans/dev/komodo/config.json' | 10 | os.homedir() + '/Projects/tektrans/dev/komodo/config.json' |
11 | ]; | 11 | ]; |
12 | 12 | ||
13 | let config; | 13 | let config; |
14 | 14 | ||
15 | for (let candindate of candindates) { | 15 | for (let candindate of candindates) { |
16 | if (fs.existsSync(candindate)) { | 16 | if (fs.existsSync(candindate)) { |
17 | //console.log(candindate + ' FOUND'); | 17 | //console.log(candindate + ' FOUND'); |
18 | try { | 18 | try { |
19 | config = require(candindate); | 19 | config = require(candindate); |
20 | config.this_config_filename = candindate; | 20 | config.this_config_filename = candindate; |
21 | } | 21 | } |
22 | catch(e) {} | 22 | catch(e) {} |
23 | 23 | ||
24 | break; | 24 | break; |
25 | } | 25 | } |
26 | //console.log(candindate + ' NOT FOUND'); | 26 | //console.log(candindate + ' NOT FOUND'); |
27 | } | 27 | } |
28 | 28 | ||
29 | module.exports = config; | 29 | module.exports = config; |
30 | 30 |
package.json
1 | { | 1 | { |
2 | "name": "komodo-sdk", | 2 | "name": "komodo-sdk", |
3 | "version": "1.23.3", | 3 | "version": "1.23.4", |
4 | "description": "SDK for Komodo", | 4 | "description": "SDK for Komodo", |
5 | "main": "index.js", | 5 | "main": "index.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | "test": "mocha", | 7 | "test": "mocha", |
8 | "postversion": "git push && git push --tags" | 8 | "postversion": "git push && git push --tags" |
9 | }, | 9 | }, |
10 | "repository": { | 10 | "repository": { |
11 | "type": "git", | 11 | "type": "git", |
12 | "url": "git@gitlab.kodesumber.com:komodo/komodo-sdk.git" | 12 | "url": "git@gitlab.kodesumber.com:komodo/komodo-sdk.git" |
13 | }, | 13 | }, |
14 | "keywords": [ | 14 | "keywords": [ |
15 | "ppob", | 15 | "ppob", |
16 | "payment", | 16 | "payment", |
17 | "komodo" | 17 | "komodo" |
18 | ], | 18 | ], |
19 | "author": "Adhidarma Hadiwinoto <gua@adhisimon.org>", | 19 | "author": "Adhidarma Hadiwinoto <gua@adhisimon.org>", |
20 | "license": "ISC", | 20 | "license": "ISC", |
21 | "dependencies": { | 21 | "dependencies": { |
22 | "basic-auth": "^2.0.0", | 22 | "basic-auth": "^2.0.0", |
23 | "body-parser": "^1.18.2", | 23 | "body-parser": "^1.18.2", |
24 | "express": "^4.16.3", | 24 | "express": "^4.16.3", |
25 | "express-session": "^1.15.6", | 25 | "express-session": "^1.15.6", |
26 | "lru-cache": "^4.1.1", | 26 | "lru-cache": "^4.1.1", |
27 | "macaddress": "^0.2.8", | 27 | "macaddress": "^0.2.8", |
28 | "moment": "^2.19.1", | 28 | "moment": "^2.19.1", |
29 | "node-machine-id": "^1.1.10", | 29 | "node-machine-id": "^1.1.10", |
30 | "node-natural-sort": "^0.8.6", | 30 | "node-natural-sort": "^0.8.6", |
31 | "numeral": "^2.0.6", | 31 | "numeral": "^2.0.6", |
32 | "nunjucks": "^3.0.1", | 32 | "nunjucks": "^3.0.1", |
33 | "redis": "^2.8.0", | 33 | "redis": "^2.8.0", |
34 | "request": "^2.81.0", | 34 | "request": "^2.81.0", |
35 | "sha1": "^1.1.1", | 35 | "sha1": "^1.1.1", |
36 | "simple-git": "^1.80.1", | 36 | "simple-git": "^1.80.1", |
37 | "strftime": "^0.10.0", | 37 | "strftime": "^0.10.0", |
38 | "uniqid": "^4.1.1", | 38 | "uniqid": "^4.1.1", |
39 | "uuid": "^3.1.0", | 39 | "uuid": "^3.1.0", |
40 | "winston": "^2.3.1", | 40 | "winston": "^2.3.1", |
41 | "winston-circular-buffer": "^1.0.0", | 41 | "winston-circular-buffer": "^1.0.0", |
42 | "winston-daily-rotate-file": "^1.4.6" | 42 | "winston-daily-rotate-file": "^1.4.6" |
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 |