From 67ce900885d00dea08191d02c8437c7134ec0a2c Mon Sep 17 00:00:00 2001 From: Genzer <732937+Genzer@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:17:03 +0700 Subject: [PATCH] Commit .env in tests/env-file-tests, bypassing root .gitignore This commit adds a .gitignore in tests/env-file-tests to allow .env files to be committed. Fix: #937 Signed-off-by: Genzer <732937+Genzer@users.noreply.github.com> --- tests/env-file-tests/.env | 2 ++ tests/env-file-tests/.gitignore | 4 ++++ tests/env-file-tests/project/.env | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 tests/env-file-tests/.env create mode 100644 tests/env-file-tests/.gitignore create mode 100644 tests/env-file-tests/project/.env diff --git a/tests/env-file-tests/.env b/tests/env-file-tests/.env new file mode 100644 index 0000000..0c167ce --- /dev/null +++ b/tests/env-file-tests/.env @@ -0,0 +1,2 @@ +ZZVAR1='This value is overwritten by env-file-tests/.env' +ZZVAR3='This value is loaded from env-file-tests/.env' diff --git a/tests/env-file-tests/.gitignore b/tests/env-file-tests/.gitignore new file mode 100644 index 0000000..e157843 --- /dev/null +++ b/tests/env-file-tests/.gitignore @@ -0,0 +1,4 @@ +# This overrides the repository root .gitignore (ignoring all .env). +# The .env files in this directory are important for the test cases. +!.env +!project/.env diff --git a/tests/env-file-tests/project/.env b/tests/env-file-tests/project/.env new file mode 100644 index 0000000..cc2c0ce --- /dev/null +++ b/tests/env-file-tests/project/.env @@ -0,0 +1,2 @@ +ZZVAR1='This value is loaded but should be overwritten' +ZZVAR2='This value is loaded from .env in project/ directory'