From 3ae70069b3651a33b5f0f8ddebc93a83120f9b17 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Mon, 19 Apr 2021 20:05:33 +0100 Subject: [PATCH] fix: fix release and build scripts --- _tools/build-stylesheets.sh | 1 - _tools/build.sh | 14 +++++++++----- _tools/release.sh | 8 +++++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/_tools/build-stylesheets.sh b/_tools/build-stylesheets.sh index 2d14f33..f8f5f0b 100755 --- a/_tools/build-stylesheets.sh +++ b/_tools/build-stylesheets.sh @@ -52,7 +52,6 @@ elif [[ $1 == "-d" ]]; then # with `cp` and disabled the `rm` command, so the minified # files won't be removed from the source directory. echo "Deploying minified stylesheets to \`dist/css/\`..." - rm -r ./dist mkdir -p ./dist/css for f in ./css/tmp/*.min.css; do filename=$(basename $f .css) diff --git a/_tools/build.sh b/_tools/build.sh index aa89c41..3747ec9 100755 --- a/_tools/build.sh +++ b/_tools/build.sh @@ -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." diff --git a/_tools/release.sh b/_tools/release.sh index 11d74f0..e3673f8 100755 --- a/_tools/release.sh +++ b/_tools/release.sh @@ -224,8 +224,9 @@ echo "Current version:" echo -e '\t' $PRERELEASE_VERSION echo "Stable version:" echo -e '\t' $STABLE_VERSION '\n' -echo "Commit message:\n" +echo -e "Commit message:\n" echo -e "$CHANGELOG_MESSAGE" '\n' +svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm % echo -e "Changes made to local \`trunk/\`:\n" svn stat tmp/trunk/ 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) 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." fi # Step 8: Cleanup -rm -rf {dist/,tmp/} +#rm -rf {dist/,tmp/}