Skip to content

Commit

Permalink
Make phive install command complain when there are no phars to install
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Aug 22, 2024
1 parent 147fadd commit 643be40
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/commands/install/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public function __construct(
public function execute(): void {
$targetDirectory = $this->getConfig()->getTargetDirectory();

foreach ($this->getConfig()->getRequestedPhars() as $requestedPhar) {
$todo = $this->getConfig()->getRequestedPhars();
if (count($todo) === 0) {
throw new InstallationFailedException('No phars to install');
}

foreach ($todo as $requestedPhar) {
$this->installRequestedPhar($requestedPhar, $targetDirectory);
}
}
Expand Down

0 comments on commit 643be40

Please sign in to comment.