Skip to content

Commit

Permalink
Resolve path after checking it leads to an existing file
Browse files Browse the repository at this point in the history
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
  • Loading branch information
greg0ire committed Jan 21, 2024
1 parent 0923715 commit b7c7041
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/guides
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b7c7041

Please # to comment.