Skip to content

Commit

Permalink
fix: use target when finding releases
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Oct 23, 2024
1 parent f68f031 commit d6f7a46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Command/FileUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$io = new SymfonyStyle($input, $output);
$filename = Path::canonicalize(\sprintf('%s/%s', \getcwd(), $input->getOption('filename')));
$repository = (new Factory())->repository($input->getOption('repository'));
$latest = $repository->releases()->latest();
$target = $input->getOption('target');
$target = $input->getOption('target') ?? $repository->defaultBranch();
$latest = $repository->releases()->on($target)->latest();
$remote = $input->getOption('remote');

if (!$latest) {
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ReleaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$repository = (new Factory())->repository($input->getOption('repository'));
$from = $input->getOption('from') ?? $repository->releases()->latest();
$target = $input->getOption('target') ?? $repository->defaultBranch();
$from = $input->getOption('from') ?? $repository->releases()->on($target)->latest();
$comparison = $repository->compare($target, $from);
$body = [];

Expand Down

0 comments on commit d6f7a46

Please sign in to comment.