Skip to content

Commit

Permalink
Merge pull request #930 from garvinhicking/support-short-code
Browse files Browse the repository at this point in the history
[BUGFIX] Fix non-working short-options for "config" and "working-dir"
  • Loading branch information
jaapio authored Mar 19, 2024
2 parents 20c1b43 + e386a79 commit 89b8429
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/guides-cli/bin/guides
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 !== false && $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) {
Expand Down

0 comments on commit 89b8429

Please sign in to comment.