From 96635b4a20189848cfc1bd7a116b630596222098 Mon Sep 17 00:00:00 2001 From: Darren Ethier Date: Thu, 5 Mar 2020 12:04:40 -0500 Subject: [PATCH] updates to plugin build script to allow for dev plugin zip builds --- bin/build-plugin-zip.sh | 48 +++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/bin/build-plugin-zip.sh b/bin/build-plugin-zip.sh index 6dd7b7f05cb..0aeceb3cc37 100755 --- a/bin/build-plugin-zip.sh +++ b/bin/build-plugin-zip.sh @@ -3,6 +3,31 @@ # Exit if any command fails. set -e +TYPE='PRODUCTION'; + +print_usage() { + echo "build-plugin-zip - attempt to build a plugin" + echo " " + echo "build-plugin-zip [arguments]" + echo " " + echo "options:" + echo "-h show brief help" + echo "-d build plugin in development mode" +} + +# get args +while getopts 'hd' flag; do + case "${flag}" in + h) print_usage ;; + d) TYPE='DEV' ;; + *) + print_usage + exit 1 + ;; + esac +done + + # Store paths SOURCE_PATH=$(pwd) @@ -79,16 +104,21 @@ if [ -z "$NO_CHECKS" ]; then fi # Run the build. -status "Installing dependencies... 📦" -composer install --no-dev -PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install -status "===========================" -npm list webpack -status "Generating build... 👷‍♀️" -status "===========================" npm list webpack -npm run build -status "===========================" +if [ $TYPE = 'DEV' ]; then + status "Generating development build... 👷‍♀️" + status "===========================" +else + status "Installing dependencies... 📦" + composer install --no-dev + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install + status "===========================" + status "Generating production build... 👷‍♀️" + status "===========================" + npm list webpack + npm run build + status "===========================" +fi npm list webpack # Generate the plugin zip file.