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

@ -52,7 +52,6 @@ elif [[ $1 == "-d" ]]; then
# with `cp` and disabled the `rm` command, so the minified # with `cp` and disabled the `rm` command, so the minified
# files won't be removed from the source directory. # files won't be removed from the source directory.
echo "Deploying minified stylesheets to \`dist/css/\`..." echo "Deploying minified stylesheets to \`dist/css/\`..."
rm -r ./dist
mkdir -p ./dist/css mkdir -p ./dist/css
for f in ./css/tmp/*.min.css; do for f in ./css/tmp/*.min.css; do
filename=$(basename $f .css) filename=$(basename $f .css)

View file

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

View file

@ -224,8 +224,9 @@ echo "Current version:"
echo -e '\t' $PRERELEASE_VERSION echo -e '\t' $PRERELEASE_VERSION
echo "Stable version:" echo "Stable version:"
echo -e '\t' $STABLE_VERSION '\n' echo -e '\t' $STABLE_VERSION '\n'
echo "Commit message:\n" echo -e "Commit message:\n"
echo -e "$CHANGELOG_MESSAGE" '\n' echo -e "$CHANGELOG_MESSAGE" '\n'
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %
echo -e "Changes made to local \`trunk/\`:\n" echo -e "Changes made to local \`trunk/\`:\n"
svn stat tmp/trunk/ svn stat tmp/trunk/
echo "" echo ""
@ -237,10 +238,11 @@ read -p "Is this all correct? (Y/N): " CONFIRM && [[ $CONFIRM == [yY] || $CONFIR
# Step 7(d): Push to remote `trunk/` (provided the flag is set) # Step 7(d): Push to remote `trunk/` (provided the flag is set)
if [[ $1 == "-c" ]]; then if [[ $1 == "-c" ]]; then
svn ci -m "$CHANGELOG_MESSAGE" cd tmp && svn ci -m "$CHANGELOG_MESSAGE"
cd ..
else echo "- Commit flag not set, skipping commit step." else echo "- Commit flag not set, skipping commit step."
fi fi
# Step 8: Cleanup # Step 8: Cleanup
rm -rf {dist/,tmp/} #rm -rf {dist/,tmp/}