Skip to content

Commit 688c97d

Browse files
committed
Do not include config files twice
1 parent b7d2835 commit 688c97d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/guides-cli/bin/guides

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,19 @@ if ($input->hasParameterOption('-vvv', true)) {
4040

4141
$containerFactory = new ContainerFactory([new ApplicationExtension()]);
4242

43-
if (is_file($vendorDir . '/../guides.xml')) {
43+
$projectConfig = realpath($vendorDir . '/../guides.xml');
44+
if (is_file($projectConfig)) {
4445
if ($verbosity === 3) {
45-
echo 'Loading guides.xml from ' . $vendorDir . '/../guides.xml' . PHP_EOL;
46+
echo 'Loading guides.xml from ' . $projectConfig . PHP_EOL;
4647
}
4748
// vendor folder was placed directly into the project directory
48-
$containerFactory->addConfigFile($vendorDir . '/../guides.xml');
49+
$containerFactory->addConfigFile($projectConfig);
4950
}
5051

5152
$workingDir = $input->getParameterOption('--working-dir', getcwd(), true);
5253
$localConfig = $input->getParameterOption('--config', $workingDir, true).'/guides.xml';
5354

54-
if (is_file($localConfig)) {
55+
if (is_file($localConfig) && realpath($localConfig) !== $projectConfig) {
5556
if ($verbosity === 3) {
5657
echo 'Loading guides.xml from ' . $localConfig . PHP_EOL;
5758
}

0 commit comments

Comments
 (0)