From 4b9ad86f76f416fae009476d3c50d588b7e7043b Mon Sep 17 00:00:00 2001 From: Naman Kumar Date: Mon, 18 May 2020 07:08:47 +0530 Subject: [PATCH] Accept custom env file path --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f322dfc..1d36327 100644 --- a/index.js +++ b/index.js @@ -11,8 +11,8 @@ function format (key, value) { return `${key}=${escapeNewlines(value)}` } -module.exports = async function updateDotenv (env) { - const filename = path.join(process.cwd(), '.env') +module.exports = async function updateDotenv (env, options = {}) { + const filename = options.path || path.join(process.cwd(), '.env') // Merge with existing values try {