aboutsummaryrefslogtreecommitdiffstats
path: root/build/autoloaderchecker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build/autoloaderchecker.sh')
-rwxr-xr-xbuild/autoloaderchecker.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/build/autoloaderchecker.sh b/build/autoloaderchecker.sh
index 09bcff0b853..75db26f07ce 100755
--- a/build/autoloaderchecker.sh
+++ b/build/autoloaderchecker.sh
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
+# SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
COMPOSER_COMMAND="php composer.phar"
if [ -e "composer.phar" ]
@@ -31,6 +34,13 @@ echo
echo "Regenerating main autoloader"
$COMPOSER_COMMAND dump-autoload -d $REPODIR
+FOUND_COMPOSER_BIN=$(grep --recursive --fixed-strings 'Bamarni\\Composer\\Bin' $REPODIR/lib/composer/composer/)
+if [ -n "$FOUND_COMPOSER_BIN" ]; then
+ echo "The main autoloader contains the composer bin plugin"
+ echo "Run composer again with --no-dev and commit the result"
+ exit 1
+fi
+
for app in ${REPODIR}/apps/*; do
if git check-ignore ${app} -q ; then
echo
@@ -42,6 +52,7 @@ for app in ${REPODIR}/apps/*; do
echo "Regenerating composer files for ${app}"
$COMPOSER_COMMAND i --no-dev -d ${app}/composer || exit 1
$COMPOSER_COMMAND dump-autoload -d ${app}/composer || exit 1
+ git checkout ${app}/composer/composer/installed.php
fi
done