Skip to content

Commit 42cb3ee

Browse files
committed
feat: add condition when ENV is production
Signed-off-by: Matheus Cruz <[email protected]>
1 parent 589858f commit 42cb3ee

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

whatsapp/src/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
const path = require("path")
22

3-
require("dotenv").config({
4-
path: path.resolve(
5-
process.cwd(),
6-
process.env.ENV === "local" ? ".env.local" : ".env"
7-
),
8-
})
3+
if (process.env.ENV !== "production") {
4+
require("dotenv").config({
5+
path: path.resolve(
6+
process.cwd(),
7+
process.env.ENV === "local" ? ".env.local" : ".env"
8+
),
9+
})
10+
}
911

1012
const { Client, LocalAuth } = require("whatsapp-web.js")
1113
const qrcode = require("qrcode-terminal")

0 commit comments

Comments
 (0)