Skip to content

Commit

Permalink
[BUGFIX] Fix non-working short-options for "config" and "working-dir"
Browse files Browse the repository at this point in the history
  • Loading branch information
garvinhicking authored and jaapio committed Mar 19, 2024
1 parent 20c1b43 commit 08d2a89
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) {
$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 08d2a89

Please sign in to comment.