Skip to content

Commit ddfc781

Browse files
committed
FEATURE: make prunner-version overridable through root composer.json
1 parent 72c9d5a commit ddfc781

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

Classes/Composer/InstallerScripts.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,20 @@ class InstallerScripts
2929
fi
3030
EOD;
3131

32+
const DEFAULT_VERSION_TO_INSTALL = '0.2.0';
3233

3334
public static function postUpdateAndInstall(Event $event)
3435
{
3536
$platform = php_uname('s'); // stuff like Darwin etc
3637
$architecture = php_uname('m'); // x86_64
3738

38-
$version = '0.2.0';
39+
$extra = $event->getComposer()->getPackage()->getExtra();
40+
$version = self::DEFAULT_VERSION_TO_INSTALL;
41+
$versionMessage = '';
42+
if (isset($extra['prunner-version'])) {
43+
$version = $extra['prunner-version'];
44+
$versionMessage = ' (OVERRIDDEN in composer.json)';
45+
}
3946

4047
$baseDirectory = 'prunner';
4148
$platformSpecificTargetDirectory = $baseDirectory . '/' . $platform . '_' . $architecture;
@@ -47,7 +54,7 @@ public static function postUpdateAndInstall(Event $event)
4754
}
4855
if (!file_exists($platformSpecificTargetDirectory . '/prunner')) {
4956
echo '> Downloading prunner from https://github.com/Flowpack/prunner' . "\n";
50-
echo '> Version: ' . $version . "\n";
57+
echo '> Version: ' . $version . $versionMessage . "\n";
5158
echo '> Platform: ' . $platform . "\n";
5259
echo '> Architecture: ' . $architecture . "\n";
5360
$downloadLink = sprintf('https://github.com/Flowpack/prunner/releases/download/v%s/prunner_%s_%s_%s.tar.gz', $version, $version, $platform, $architecture);

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ prunner/prunner --path Packages --data Data/Persistent/prunner
4242

4343
This will parse all packages for `pipelines.yml` files.
4444

45+
## Overriding the Prunner Version
46+
47+
By default, the prunner version configured in `Flowpack\Prunner\Composer\InstallerScripts::DEFAULT_VERSION_TO_INSTALL`
48+
will be downloaded. However, it is possible to override this via `extra.prunner-version` in the root `composer.json`:
49+
50+
```json
51+
{
52+
"extra": {
53+
"prunner-version": "0.4.0"
54+
}
55+
}
56+
```
4557

4658
## Building the UI package
4759

0 commit comments

Comments
 (0)