Clean up some old code

This commit is contained in:
Toby Zerner 2015-10-22 12:25:22 +10:30
parent 2c87f36869
commit b482fb93c5
3 changed files with 2 additions and 84 deletions

View File

@ -295,23 +295,6 @@ export default class App {
this.modal.show(new RequestErrorModal({error}));
}
/**
* Show alert error messages for each error returned in an API response.
*
* @param {Object} response
* @public
*/
alertErrors(response) {
if (response.errors) {
response.errors.forEach(error => {
this.alerts.show(new Alert({
type: 'error',
children: error.detail
}));
});
}
}
/**
* Construct a URL to the route with the given name.
*

View File

@ -10,8 +10,8 @@ bower install
cd "${base}/js/forum"
npm install
gulp --production
gulp
cd "${base}/js/admin"
npm install
gulp --production
gulp

View File

@ -1,65 +0,0 @@
#!/usr/bin/env bash
base=${PWD}
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
# Delete files
rm -rf ${release}/build.sh
# Install all Composer dependencies
composer install --prefer-dist --optimize-autoloader --ignore-platform-reqs --no-dev
cd "${release}/js"
if [ -f bower.json ]; then
bower install
fi
for app in forum admin; do
cd "${release}/js"
if [ -d $app ]; then
cd $app
if [ -f bower.json ]; then
bower install
fi
npm install
gulp --production
rm -rf node_modules bower_components
fi
done
rm -rf "${release}/extensions/${extension}/js/bower_components"
wait
# 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