Skip to content

Commit

Permalink
Merge pull request #109 from Dartui/fix/check-input-option-presence
Browse files Browse the repository at this point in the history
fix: check input options presence when updating config from CLI
  • Loading branch information
BrianHenryIE authored Jun 10, 2024
2 parents 86e06a5 + 4827248 commit 7212a4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Composer/Extra/StraussConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public function updateFromCli(InputInterface $input): void
// strauss --updateCallSites=true
// strauss --updateCallSites=src,input,extra

if ($input->hasOption('updateCallSites')) {
if ($input->hasOption('updateCallSites') && $input->getOption('updateCallSites') !== null) {
$updateCallSitesInput = $input->getOption('updateCallSites');

if ('false' === $updateCallSitesInput) {
Expand All @@ -644,10 +644,10 @@ public function updateFromCli(InputInterface $input): void
}
}

if ($input->hasOption('deleteVendorPackages')) {
if ($input->hasOption('deleteVendorPackages') && $input->getOption('deleteVendorPackages') !== null) {
$isDeleteVendorPackagesCommandLine = $input->getOption('deleteVendorPackages') === 'true';
$this->setDeleteVendorPackages($isDeleteVendorPackagesCommandLine);
} elseif ($input->hasOption('delete_vendor_packages')) {
} elseif ($input->hasOption('delete_vendor_packages') && $input->getOption('delete_vendor_packages') !== null) {
$isDeleteVendorPackagesCommandLine = $input->getOption('delete_vendor_packages') === 'true';
$this->setDeleteVendorPackages($isDeleteVendorPackagesCommandLine);
}
Expand Down

0 comments on commit 7212a4d

Please sign in to comment.