Skip to content

Commit

Permalink
Fixes logic issue in install:dmg command.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesiscoding committed Mar 26, 2021
1 parent 3dca470 commit e00b0bd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ $command[] = new DevCoding\Jss\Helper\Command\Download\PkgInstallCommand();
$command[] = new DevCoding\Jss\Helper\Command\Download\DmgInstallCommand();
// Other Commands
$command[] = new DevCoding\Jss\Helper\Command\PrepCommand();
$app = new Application('JHelper', 'v1.2');
$app = new Application('JHelper', 'v1.2.1');
$app->addCommands($command);
$app->run();
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"DevCoding\\Jss\\Helper\\": "src"
}
},
"version": "1.2",
"version": "1.2.1",
"require": {
"php": "^7.0",
"ext-json": "*",
Expand Down
Binary file modified dist/jhelper.phar
Binary file not shown.
22 changes: 18 additions & 4 deletions src/Command/Download/DmgInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Verify we don't have a version mismatch
$offer = $File->getShortVersion();
$target = $this->getTargetVersion();
if ($offer && $target && !$target->eq($offer))
if ($offer && $target)
{
$this->io()->msg('Comparing Versions', 50);
$this->errorbg('NO MATCH');
$retval = self::EXIT_ERROR;
if ($target->eq($offer))
{
$retval = self::CONTINUE;
}
else
{
$this->io()->msg('Comparing Versions', 50);
$this->errorbg('NO MATCH');
$retval = self::EXIT_ERROR;
}
}
elseif ($offer)
{
Expand All @@ -87,6 +94,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$badge = self::CONTINUE === $retval ? 'yes' : 'no';
$this->successbg($badge);
}
else
{
$this->io()->msg('Comparing Versions', 50);
$this->errorbg('ERROR');
$this->io()->write(' Could not determine version within DMG.');
$retval = self::EXIT_ERROR;
}
}
else
{
Expand Down

0 comments on commit e00b0bd

Please sign in to comment.