From 6e5b827ce882673e696b5f463ceffc91512753a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erdem=20K=C3=B6=C5=9Fk?= Date: Wed, 24 Jan 2024 10:03:15 +0300 Subject: [PATCH] hotfix on generation on .env-example for empty check --- .env-example | 2 -- lib/handler/envHandler.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 .env-example diff --git a/.env-example b/.env-example deleted file mode 100644 index 6bd3c8f..0000000 --- a/.env-example +++ /dev/null @@ -1,2 +0,0 @@ -TEST= -TEST1= \ No newline at end of file diff --git a/lib/handler/envHandler.ts b/lib/handler/envHandler.ts index a34711d..ad81079 100644 --- a/lib/handler/envHandler.ts +++ b/lib/handler/envHandler.ts @@ -348,7 +348,7 @@ export async function generateEnvExampleFile (): Promise { const envValues = await getValuesInEnv({ targetPath: path.join(currentDirectory, '.env') }) - const result = envValues.data.map(innerArr => innerArr[0] + '=').join('\n') + const result = envValues.data.map(innerArr => innerArr[0] !== '' ? innerArr[0] + '=' : '').join('\n') await writeFile(path.join(currentDirectory, '.env-example'), result) diff --git a/package-lock.json b/package-lock.json index 92b0af5..3ee4fcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "envolve", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "envolve", - "version": "1.2.0", + "version": "1.2.1", "license": "ISC", "dependencies": { "chalk": "4.0.0", diff --git a/package.json b/package.json index eecf52f..047d05e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "envolve", - "version": "1.2.1", + "version": "1.2.2", "description": "Envolve CLI is a powerful tool for managing environment variables in your projects. It allows you to easily create, update, compare, and sync environment files across different services.", "main": "index.ts", "scripts": {