fix: fix release and build scripts

This commit is contained in:
Ben Goldsworthy 2021-04-19 20:05:33 +01:00
parent 95787e597c
commit 3ae70069b3
3 changed files with 14 additions and 9 deletions

View file

@ -4,13 +4,15 @@ echo "Building Plugin..."
# Moves everything including the style sheets over to `dist/`
echo "Copying directories..."
rm -r dist/
mkdir dist
cp -r -t dist class/ css/ js/ languages/ templates/
# Among the images, only 2 out of 3 are distributed.
echo "Copying the needed images..."
mkdir dist/img
cp -t dist/img img/fn-wysiwyg.png img/main-menu.png
mkdir -p dist/img
cp -t dist/img img/fn-wysiwyg.png
echo "Copying files..."
cp -t dist features.txt license.txt readme.txt includes.php wpml-config.xml customized-documentation-schema.txt customized-template-stack.txt CONTRIBUTING.md README.md SECURITY.md
cp -t dist license.txt readme.txt includes.php wpml-config.xml SECURITY.md
echo "Setting production flag..."
sed "s/'PRODUCTION_ENV', false/'PRODUCTION_ENV', true/g" footnotes.php > dist/footnotes.php
echo "Production flag set."
@ -21,8 +23,10 @@ echo "Production flag set."
echo "Building stylesheets..."
./_tools/build-stylesheets.sh -c
if [ $? != 0 ]; then echo "Concatenation failed!"; exit 1; fi
./_tools/build-stylesheets.sh -m
if [ $? != 0 ]; then echo "Minification failed!"; exit 1; fi
if [[ $1 != "-y" ]]; then
./_tools/build-stylesheets.sh -m
if [ $? != 0 ]; then echo "Minification failed!"; exit 1; fi
fi
./_tools/build-stylesheets.sh -d
if [ $? != 0 ]; then echo "Deployment failed!"; exit 1; fi
echo "Stylesheet build complete."