Skip to content

Commit 1bbdb50

Browse files
committed
Get rid of extra install step to patch main composer.json
1 parent 905c70f commit 1bbdb50

4 files changed

Lines changed: 9 additions & 70 deletions

File tree

Classes/Command/PrunnerCommandController.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

Classes/Composer/InstallerScripts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
namespace Flowpack\Prunner\Composer;
55

6-
use Composer\Script\Event;
76
use GuzzleHttp\Client;
87
use Neos\Utility\Files;
98
use PharData;
@@ -46,12 +45,13 @@ class InstallerScripts
4645

4746
const DEFAULT_VERSION_TO_INSTALL = '0.8.1';
4847

49-
public static function postUpdateAndInstall(Event $event)
48+
public static function postUpdateAndInstall()
5049
{
5150
$platform = php_uname('s'); // stuff like Darwin etc
5251
$architecture = php_uname('m'); // x86_64
5352

54-
$extra = $event->getComposer()->getPackage()->getExtra();
53+
$composerJson = json_decode(file_get_contents('composer.json'), true);
54+
$extra = isset($composerJson['extra']) ? $composerJson['extra'] : [];
5555
$version = self::DEFAULT_VERSION_TO_INSTALL;
5656
$versionMessage = '';
5757
if (isset($extra['prunner-version'])) {

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,7 @@ A Neos/Flow PHP package providing a backend module for the current pipeline stat
2222
## Installation
2323

2424
```bash
25-
# add the package
2625
composer require flowpack/prunner
27-
28-
# patch main composer.json to add Flowpack\Prunner\Composer\InstallerScripts::postUpdateAndInstall to post-install-cmd and post-update-cmd
29-
./flow prunner:setupProject
30-
31-
# run composer install again, to download prunner.
32-
composer install
33-
34-
# prunner is now installed in your project root, as "prunner/prunner"
3526
```
3627

3728
Now, start up prunner via the following command:
@@ -40,7 +31,7 @@ Now, start up prunner via the following command:
4031
prunner/prunner --path Packages --data Data/Persistent/prunner
4132
```
4233

43-
This will parse all packages for `pipelines.yml` files.
34+
This will parse all packages for `pipelines.yml` files.
4435

4536
## Overriding the Prunner Version
4637

@@ -65,7 +56,7 @@ Then, copy the `index.js` and `index.css` files to this package:
6556
```bash
6657
export PRUNNERUI=/path/to/prunner-ui
6758
cp $PRUNNERUI/build/dist/index.js* Resources/Public/prunner-ui/
68-
cp $PRUNNERUI/build/index.css Resources/Public/prunner-ui/index.css
59+
cp $PRUNNERUI/build/index.css Resources/Public/prunner-ui/index.css
6960
```
7061

7162
## License

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"extra": {
2121
"neos": {
2222
"package-key": "Flowpack.Prunner"
23+
},
24+
"neos/flow": {
25+
"post-install": "Flowpack\\Prunner\\Composer\\InstallerScripts::postUpdateAndInstall",
26+
"post-update": "Flowpack\\Prunner\\Composer\\InstallerScripts::postUpdateAndInstall"
2327
}
2428
}
2529
}

0 commit comments

Comments
 (0)