Skip to content

Commit

Permalink
feat: add version to command
Browse files Browse the repository at this point in the history
Adds dependency on ocramius/package-versions, and updates
`bin/laminas-migration` to detect the version using that tool, and add
it to the `Symfony\Component\Console\Application` it creates so that the
tool reports a version.
  • Loading branch information
weierophinney committed Jan 9, 2020
1 parent db3f995 commit 76f604d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/laminas-migration
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Laminas\Migration;

use PackageVersions\Versions;
use Symfony\Component\Console\Application;

if (file_exists($a = __DIR__ . '/../../../autoload.php')) {
Expand All @@ -22,7 +23,9 @@ if (file_exists($a = __DIR__ . '/../../../autoload.php')) {
exit(1);
}

$application = new Application('laminas-migration');
$version = strstr(Versions::getVersion('laminas/laminas-migration'), '@', true);

$application = new Application('laminas-migration', $version);
$application->addCommands([
new Command\MigrateCommand(),
new Command\NestedDepsCommand(),
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"php": "^5.6 || ^7.0",
"ext-json": "*",
"laminas/laminas-zendframework-bridge": "^1.0",
"ocramius/package-versions": "^1.4",
"symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0"
},
"require-dev": {
Expand Down

0 comments on commit 76f604d

Please sign in to comment.