Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Fixed .env include #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.db
node_modules
components/routes/_*
.env
6 changes: 4 additions & 2 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ This bot demonstrates many of the core features of Botkit:
-> http://howdy.ai/botkit

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
var env = require('node-env-file');
env(__dirname + '/.env');
if (process.env.NODE_ENV !== 'production') {
var env = require('node-env-file');
env(__dirname + '/.env');
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional logic would be unnecessary if dotenv were used in place of node-env-file

https://github.com/motdotla/dotenv

  • node-env-file also appears to be broken, in the sense that there is unconventional behavior: ENV values that are defined later do not override those defined earlier.


if (!process.env.clientId || !process.env.clientSecret || !process.env.PORT) {
Expand Down