diff options
author | Joas Schilling <coding@schilljs.com> | 2023-04-21 15:53:06 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-04-21 15:53:06 +0200 |
commit | f194314aaf2c8ce65a9e7bc8183acad72c6ea121 (patch) | |
tree | ab9cd61ca1d0fce0652737bcae463c3749a03734 /build/autoloaderchecker.sh | |
parent | dd3d689e04a5e1d558da937ca72980e0e2c7c404 (diff) | |
download | nextcloud-server-f194314aaf2c8ce65a9e7bc8183acad72c6ea121.tar.gz nextcloud-server-f194314aaf2c8ce65a9e7bc8183acad72c6ea121.zip |
chore(CI): Require a minimum composer version to make sure the autoloader is okay
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'build/autoloaderchecker.sh')
-rwxr-xr-x | build/autoloaderchecker.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/build/autoloaderchecker.sh b/build/autoloaderchecker.sh index 19ae6a71731..da3a7ef2546 100755 --- a/build/autoloaderchecker.sh +++ b/build/autoloaderchecker.sh @@ -14,6 +14,16 @@ else fi +COMPOSER_VERSION=$($COMPOSER_COMMAND --version | cut -d" " -f3) +COMPOSER_MAJOR_VERSION=$(echo "$COMPOSER_VERSION" | cut -d"." -f1) +COMPOSER_MINOR_VERSION=$(echo "$COMPOSER_VERSION" | cut -d"." -f2) +COMPOSER_PATCH_VERSION=$(echo "$COMPOSER_VERSION" | cut -d"." -f3) + +if ! [ "$COMPOSER_MAJOR_VERSION" -gt 2 -o \( "$COMPOSER_MAJOR_VERSION" -eq 2 -a "$COMPOSER_MINOR_VERSION" -ge 6 \) -o \( "$COMPOSER_MAJOR_VERSION" -eq 2 -a "$COMPOSER_MINOR_VERSION" -eq 5 -a "$COMPOSER_PATCH_VERSION" -ge 5 \) ]; then + echo "composer version >= 2.5.5 required. Version found: $COMPOSER_VERSION" >&2 + exit 1 +fi + REPODIR=`git rev-parse --show-toplevel` #Redump the main autoloader |