diff --git a/README.md b/README.md index 3b58103f..a4640766 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ It has been extracted as a separate project to make maintenance easier and enabl * composer - [Dependency Manager for PHP](https://getcomposer.org/) * composer-bin-plugin - [Composer plugin to install bin vendors in isolated locations](https://github.com/bamarni/composer-bin-plugin) -* box - [An application for building and managing Phars](https://box-project.github.io/box2/) +* box - [Fast, zero config application bundler with PHARs](https://github.com/humbug/box) +* box-legacy - [Legacy version of box](https://box-project.github.io/box2/) * analyze - [Visualizes metrics and source code](https://github.com/Qafoo/QualityAnalyzer) * behat - [Helps to test business expectations](http://behat.org/) * churn - [Discovers good candidates for refactoring](https://github.com/bmitch/churn-php) diff --git a/bin/devkit.php b/bin/devkit.php index f132f977..01455743 100755 --- a/bin/devkit.php +++ b/bin/devkit.php @@ -65,6 +65,8 @@ protected function execute(InputInterface $input, OutputInterface $output) file_put_contents($readmePath, $readme); $output->writeln(sprintf('The %s was updated with latest tools found in %s.', $readmePath, implode(', ', $jsonPath))); + + return 0; } } ); @@ -171,6 +173,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $tools = $this->loadTools($input->getOption('tools'), new Filter([\Zalas\Toolbox\UseCase\InstallTools::PRE_INSTALLATION_TAG], [])); $output->writeln($this->renderPage($tools->map($this->toolToHtml()))); + + return 0; } private function toolToHtml(): \Closure diff --git a/resources/pre-installation.json b/resources/pre-installation.json index 9f5a0480..faaf67ed 100644 --- a/resources/pre-installation.json +++ b/resources/pre-installation.json @@ -29,14 +29,27 @@ }, { "name": "box", - "summary": "An application for building and managing Phars", + "summary": "Fast, zero config application bundler with PHARs", + "website": "https://github.com/humbug/box", + "command": { + "phar-download": { + "phar": "https://github.com/humbug/box/releases/download/3.8.4/box.phar", + "bin": "%target-dir%/box" + } + }, + "test": "box list", + "tags": ["pre-installation"] + }, + { + "name": "box-legacy", + "summary": "Legacy version of box", "website": "https://box-project.github.io/box2/", "command": { "sh": { - "command": "curl -Ls https://box-project.github.io/box2/installer.php | php && mv box.phar %target-dir%/box && chmod +x %target-dir%/box" + "command": "curl -Ls https://box-project.github.io/box2/installer.php | php && mv box.phar %target-dir%/box-legacy && chmod +x %target-dir%/box-legacy" } }, - "test": "box list", + "test": "box-legacy list", "tags": ["pre-installation"] } ] diff --git a/src/Tool/Command/BoxBuildCommand.php b/src/Tool/Command/BoxBuildCommand.php index bcada084..972825ab 100644 --- a/src/Tool/Command/BoxBuildCommand.php +++ b/src/Tool/Command/BoxBuildCommand.php @@ -24,7 +24,7 @@ public function __construct(string $repository, string $phar, string $bin, strin public function __toString(): string { return \sprintf( - 'git clone %s %s&& cd %s && git checkout %s && composer install --no-dev --no-suggest --prefer-dist -n && box build && mv %s %s && chmod +x %s && cd && rm -rf %s', + 'git clone %s %s&& cd %s && git checkout %s && composer install --no-dev --no-suggest --prefer-dist -n && box-legacy build && mv %s %s && chmod +x %s && cd && rm -rf %s', $this->repository, $this->targetDir(), $this->targetDir(), diff --git a/tests/Tool/Command/BoxBuildCommandTest.php b/tests/Tool/Command/BoxBuildCommandTest.php index 91f1a210..f06b8d96 100644 --- a/tests/Tool/Command/BoxBuildCommandTest.php +++ b/tests/Tool/Command/BoxBuildCommandTest.php @@ -45,7 +45,7 @@ public function test_it_generates_the_installation_command() $this->assertRegExp('#cd /tools/behat#', (string) $command); $this->assertRegExp('#git checkout '.self::VERSION.'#', (string) $command); $this->assertRegExp('#composer install --no-dev --no-suggest --prefer-dist -n#', (string) $command); - $this->assertRegExp('#box build#', (string) $command); + $this->assertRegExp('#box-legacy build#', (string) $command); } public function test_it_tries_to_guess_version_number_if_not_given_one() diff --git a/tests/UseCase/InstallToolsTest.php b/tests/UseCase/InstallToolsTest.php index 3c42902c..c810f5b6 100644 --- a/tests/UseCase/InstallToolsTest.php +++ b/tests/UseCase/InstallToolsTest.php @@ -141,7 +141,7 @@ public function test_it_includes_box_build_commands() $command = $this->useCase->__invoke($this->filter()); - $this->assertRegExp('#box build#', (string)$command); + $this->assertRegExp('#box-legacy build#', (string)$command); } public function test_it_includes_phar_download_commands()