aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-01-06 15:31:24 +0100
committerGitHub <noreply@github.com>2017-01-06 15:31:24 +0100
commit3ab22c2df53c8b86cbd72037ab407327b18cce11 (patch)
treed007eacbc403f4638bbe8d9e705c2f5b3910740a /build
parent73fcb69cad252ad757e61212c3490b2213b132bf (diff)
parent1a8aaad0bcdfea5a0dfcaadd0a2daae176520e46 (diff)
downloadnextcloud-server-3ab22c2df53c8b86cbd72037ab407327b18cce11.tar.gz
nextcloud-server-3ab22c2df53c8b86cbd72037ab407327b18cce11.zip
Merge pull request #2948 from nextcloud/allow-global-composer-to-be-used
Allow to use a global composer instance
Diffstat (limited to 'build')
-rw-r--r--build/autoloaderchecker.sh28
1 files changed, 19 insertions, 9 deletions
diff --git a/build/autoloaderchecker.sh b/build/autoloaderchecker.sh
index 0a1fb8ac351..b8ac493cb24 100644
--- a/build/autoloaderchecker.sh
+++ b/build/autoloaderchecker.sh
@@ -1,23 +1,33 @@
#!/usr/bin/env bash
-#Make sure we are on the latest composer
-if [ -e "composer.phar" ]
+COMPOSER_COMMAND=$(which "composer")
+if [ "$COMPOSER_COMMAND" = '' ]
then
- echo "Composer found: checking for update"
- php composer.phar self-update
+ #No global composer found, try local or download it
+ if [ -e "composer.phar" ]
+ then
+ echo "Composer found: checking for update"
+ else
+ echo "Composer not found: fetching"
+ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+ php composer-setup.php
+ php -r "unlink('composer-setup.php');"
+ fi
+
+ COMPOSER_COMMAND="php composer.phar"
else
- echo "Composer not found: fetching"
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
+ echo "Global composer found: checking for update"
fi
+#Make sure we are on the latest composer
+$COMPOSER_COMMAND self-update
+
REPODIR=`git rev-parse --show-toplevel`
#Redump the autoloader
echo
echo "Regenerating autoloader"
-php composer.phar dump-autoload -d $REPODIR
+$COMPOSER_COMMAND dump-autoload -d $REPODIR
files=`git diff --name-only`
composerfile=false