From a9905adf6cd68995429a41bcb3141ae7b8658505 Mon Sep 17 00:00:00 2001 From: MarioRadu Date: Thu, 12 Dec 2024 16:41:50 +0200 Subject: [PATCH] ignore development files on production env Signed-off-by: MarioRadu --- bin/composer-post-install-script.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/composer-post-install-script.php b/bin/composer-post-install-script.php index 60c5683..7d68892 100644 --- a/bin/composer-post-install-script.php +++ b/bin/composer-post-install-script.php @@ -26,7 +26,7 @@ function copyFile(array $file): void function getEnvironment(): string { - return file_exists('config/development.config.php') ? ENVIRONMENT_DEVELOPMENT : ENVIRONMENT_PRODUCTION; + return file_exists(realpath(__DIR__ . '/../config/development.config.php')) ? ENVIRONMENT_DEVELOPMENT : ENVIRONMENT_PRODUCTION; } // when adding files to the below array the `source` and `destination` paths must be relative to the project root folder @@ -51,4 +51,6 @@ function getEnvironment(): string echo "Using environment setting: " . getEnvironment() . PHP_EOL; +var_dump("File exists " . file_exists(realpath(__DIR__ . '/../config/development.config.php'))); + array_walk($files, 'copyFile');