1
0
mirror of https://github.com/flarum/core.git synced 2025-07-28 20:20:34 +02:00

Update for composer branch

This commit is contained in:
Toby Zerner
2015-10-13 12:29:22 +10:30
parent d76e27559e
commit d333a60aa4
18 changed files with 244 additions and 153 deletions

View File

@@ -1,44 +0,0 @@
#!/usr/bin/env bash
cd $(dirname $0)
base="${PWD}/.."
cd $base
if [ ! -f flarum.json ]; then
echo "Could not find flarum.json file!"
exit 1
fi
extension=$(php <<CODE
<?php
\$flarum = json_decode(file_get_contents('flarum.json'), true);
echo array_key_exists('name', \$flarum) ? \$flarum['name'] : '';
CODE
)
release=/tmp/${extension}
rm -rf ${release}
mkdir ${release}
git archive --format zip --worktree-attributes HEAD > ${release}/release.zip
cd ${release}
unzip release.zip -d ./
rm release.zip
bash "${base}/scripts/compile.sh"
wait
# Delete files
rm -rf ${release}/scripts
rm -rf `find . -type d -name node_modules`
rm -rf `find . -type d -name bower_components`
# Finally, create the release archive
cd ${release}
find . -type d -exec chmod 0750 {} +
find . -type f -exec chmod 0644 {} +
chmod 0775 .
zip -r ${extension}.zip ./
mv ${extension}.zip ${base}/${extension}.zip

View File

@@ -1,13 +1,27 @@
#!/usr/bin/env bash
# This script compiles the extension so that it can be used in a Flarum
# installation. It should be run from the root directory of the extension.
base=$PWD
cd $base
composer install --prefer-dist --optimize-autoloader --ignore-platform-reqs --no-dev
cd "${base}/js"
cd "${base}/js/forum"
npm install
gulp --production
if [ -f bower.json ]; then
bower install
fi
cd "${base}/js/admin"
npm install
gulp --production
for app in forum admin; do
cd "${base}/js"
if [ -d $app ]; then
cd $app
if [ -f bower.json ]; then
bower install
fi
npm install
gulp --production
fi
done