Skip to content

Commit

Permalink
Merge pull request #24 from spiral/fix/23
Browse files Browse the repository at this point in the history
Fixes problem with downloading roadrunner binary
  • Loading branch information
butschster authored Dec 1, 2021
2 parents 1364e26 + 43c51ed commit af7be95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/GetBinaryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ private function findAsset(

foreach ($filtered as $release) {
$asset = $release->getAssets()
->onlyRoadrunner()
->whereArchitecture($archOption)
->whereOperatingSystem($osOption)
->first()
Expand Down
10 changes: 10 additions & 0 deletions src/Repository/AssetsCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
*/
final class AssetsCollection extends Collection
{
/**
* @return $this
*/
public function onlyRoadrunner(): self
{
return $this->filter(static fn (AssetInterface $asset): bool =>
\str_starts_with($asset->getName(), 'roadrunner')
);
}

/**
* @param string $arch
* @return $this
Expand Down

0 comments on commit af7be95

Please sign in to comment.