Skip to content

Commit 8a1378f

Browse files
authored
Inline check-env dependency (#552)
1 parent 8084ed4 commit 8a1378f

File tree

3 files changed

+15
-55
lines changed

3 files changed

+15
-55
lines changed

lib/cli.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import fs from 'fs';
44
import program from 'commander';
55
import path from 'path';
6-
import checkEnv from 'check-env';
76
import stripJsonComments from 'strip-json-comments';
87
import { endsWith } from 'lodash';
98
import * as helpers from './helpers';
@@ -33,8 +32,8 @@ function run() {
3332
.parse(process.argv);
3433

3534
// If no config option is given, try to use the env variable:
36-
if (!program.config) checkEnv(['CONFIG_FILE']);
37-
else process.env.CONFIG_FILE = program.config;
35+
if (program.config) process.env.CONFIG_FILE = program.config;
36+
if (!process.env.CONFIG_FILE) throw new Error('Missing environment variable CONFIG_FILE');
3837

3938
const completePath = path.resolve(process.cwd(), process.env.CONFIG_FILE);
4039
const config = endsWith(process.env.CONFIG_FILE, '.js') ?

package-lock.json

Lines changed: 13 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
},
3737
"license": "MIT",
3838
"dependencies": {
39-
"check-env": "1.3.0",
4039
"commander": "^4.0.1",
4140
"discord.js": "11.5.1",
4241
"irc-colors": "1.5.0",

0 commit comments

Comments
 (0)