Skip to content

Commit 25cc1c3

Browse files
committed
[FEATURE] Search for configuration in parent of vendor
If the script is executed from any other locatation but its own project directory we need to search for the guides.xml above the vendor for the general application settings. These can be combined with the project specific settings from the parameter of the command
1 parent 1f69ca0 commit 25cc1c3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/guides-cli/bin/guides

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ if (file_exists($autoloadDirectory)){
3333
$input = new ArgvInput();
3434

3535
$containerFactory = new ContainerFactory([new ApplicationExtension()]);
36+
37+
if (is_file($vendorDir . '/../guides.xml')) {
38+
// vendor folder was placed directly into the project directory
39+
$containerFactory->addConfigFile($vendorDir . '/../guides.xml');
40+
}
3641
if (is_file($input->getParameterOption('--config', getcwd(), true).'/guides.xml')) {
37-
$containerFactory->addConfigFile('guides.xml');
42+
$containerFactory->addConfigFile($input->getParameterOption('--config', getcwd(), true).'/guides.xml');
3843
}
3944
$container = $containerFactory->create($vendorDir);
4045

0 commit comments

Comments
 (0)