From d0563068c0ab63067e79956d2e3aa90dbd4a4419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 21 Jan 2024 22:00:57 +0100 Subject: [PATCH] Resolve path after checking it leads to an existing file Running the tool without creating a guides.xml is a valid scenario, and should be supported. This means realpath() may return false, which is not a valid input for is_file(). Fixes #824 --- packages/guides-cli/bin/guides | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/guides-cli/bin/guides b/packages/guides-cli/bin/guides index 21d41441b..04cacc77f 100755 --- a/packages/guides-cli/bin/guides +++ b/packages/guides-cli/bin/guides @@ -40,8 +40,9 @@ if ($input->hasParameterOption('-vvv', true)) { $containerFactory = new ContainerFactory([new ApplicationExtension()]); -$projectConfig = realpath($vendorDir . '/../guides.xml'); +$projectConfig = $vendorDir . '/../guides.xml'; if (is_file($projectConfig)) { + $projectConfig = realpath($vendorDir . '/../guides.xml'); if ($verbosity === 3) { echo 'Loading guides.xml from ' . $projectConfig . PHP_EOL; }