From e032b93fd7258e2f8606f32e20452054decb3eb0 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 15 Mar 2024 13:30:52 +0100 Subject: [PATCH 1/2] [BUGFIX] Fix non-working short-options for "config" and "working-dir" (cherry picked from commit 08d2a891770c7525d985e1e08dba870c10432b28) --- packages/guides-cli/bin/guides | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/guides-cli/bin/guides b/packages/guides-cli/bin/guides index 04cacc77f..53f055601 100755 --- a/packages/guides-cli/bin/guides +++ b/packages/guides-cli/bin/guides @@ -9,7 +9,6 @@ use Symfony\Component\Console\Input\ArgvInput; use phpDocumentor\Guides\Cli\Application; use phpDocumentor\Guides\Cli\DependencyInjection\ApplicationExtension; use phpDocumentor\Guides\Cli\DependencyInjection\ContainerFactory; -use Symfony\Component\Console\Output\ConsoleOutput; $vendorDir = dirname(__DIR__) . '/../../vendor'; $autoloadDirectory = $vendorDir . '/autoload.php'; @@ -47,11 +46,13 @@ if (is_file($projectConfig)) { echo 'Loading guides.xml from ' . $projectConfig . PHP_EOL; } // vendor folder was placed directly into the project directory - $containerFactory->addConfigFile($projectConfig); + if ($projectConfig) { + $containerFactory->addConfigFile($projectConfig); + } } -$workingDir = $input->getParameterOption('--working-dir', getcwd(), true); -$localConfig = $input->getParameterOption('--config', $workingDir, true).'/guides.xml'; +$workingDir = $input->getParameterOption(['--working-dir', '-w'], getcwd(), true); +$localConfig = $input->getParameterOption(['--config', '-c'], $workingDir, true) . '/guides.xml'; if (is_file($localConfig) && realpath($localConfig) !== $projectConfig) { if ($verbosity === 3) { From 66fdbbb3b8178455232b4ccfe69fa3968ff1f4a3 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Tue, 19 Mar 2024 21:03:54 +0100 Subject: [PATCH 2/2] [TASK] Improve type check (cherry picked from commit e386a7987eb2a8803465d7e7d35197b7e11a865f) --- packages/guides-cli/bin/guides | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/guides-cli/bin/guides b/packages/guides-cli/bin/guides index 53f055601..9f9364df4 100755 --- a/packages/guides-cli/bin/guides +++ b/packages/guides-cli/bin/guides @@ -46,7 +46,7 @@ if (is_file($projectConfig)) { echo 'Loading guides.xml from ' . $projectConfig . PHP_EOL; } // vendor folder was placed directly into the project directory - if ($projectConfig) { + if ($projectConfig !== false && $projectConfig !== '') { $containerFactory->addConfigFile($projectConfig); } }