From c4a68a0e80200297b52a208bbceed666d32e9957 Mon Sep 17 00:00:00 2001
From: Ryan Smith <0ryansmith1994@gmail.com>
Date: Mon, 10 Aug 2015 11:51:25 +0100
Subject: [PATCH] Updates build script.

---
 build.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/build.sh b/build.sh
index 8d9715a..efb0a1a 100755
--- a/build.sh
+++ b/build.sh
@@ -1,11 +1,25 @@
 #!/usr/bin/env sh
 
+# Creates a folder to zip.
 rm -f xapi.zip
-composer install --no-interaction --no-dev
+php -r "readfile('https://getcomposer.org/installer');" | php
+php composer.phar install --no-interaction --no-dev
 cp -r . ../moodle_logstore_build
+
+# Removes unused files and folders.
+find ../moodle_logstore_build -type d -name 'tests' | xargs rm -rf
+find ../moodle_logstore_build -type d -name 'docs' | xargs rm -rf
+find ../moodle_logstore_build -type d -name '.git' | xargs rm -rf
+find ../moodle_logstore_build -type f -name 'composer.*' | xargs rm -rf
+find ../moodle_logstore_build -type f -name 'phpunit.*' | xargs rm -rf
+find ../moodle_logstore_build -type f -name '*.md' | xargs rm -rf
+
+# Creates the zip file.
 mv ../moodle_logstore_build xapi
 zip -r xapi.zip xapi -x "xapi/.git/**/*"
 rm -rf xapi
+
+# Updates Github.
 git add xapi.zip
 git commit -m "Builds zip file."
 git push
-- 
GitLab