Commit 7b6dd90aefe874b33a902ade0d1b156a8b3bb0dd
1 parent
ebacf060c6
Exists in
master
Config filename can be config.json or config.js
Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff
config.js
1 | -"use strict"; | |
1 | +'use strict'; | |
2 | 2 | |
3 | 3 | const fs = require('fs'); |
4 | 4 | const configFiller = require('./config-filler'); |
5 | 5 | |
6 | -let configFile = process.cwd() + "/config.json"; | |
6 | +let configFile = process.cwd() + '/config.json'; | |
7 | 7 | |
8 | 8 | if (!fs.existsSync(configFile)) { |
9 | - console.trace('Config file not found. Terminating'); | |
10 | - //setImmediate(function() { | |
11 | - process.exit(1); | |
12 | - //}); | |
9 | + configFile = process.cwd() + '/config.js'; | |
10 | + if (!fs.existsSync(configFile)) { | |
11 | + throw new Error("Config file not found"); | |
12 | + } | |
13 | 13 | } |
14 | 14 | |
15 | 15 | const config = require(configFile); |