#!/usr/bin/env bash
# Run from the folder that contains woo-coming-soon/ . Produces the .org (free) and Pro zips.
set -e
V=$(grep -m1 "Version:" woo-coming-soon/index.php | awk '{print $NF}')
rm -rf .dist && mkdir -p .dist/free .dist/pro
cp -r woo-coming-soon .dist/pro/ ; cp -r woo-coming-soon .dist/free/ ; rm -rf .dist/free/woo-coming-soon/pro
(cd .dist/free && zip -qr ../../woo-coming-soon-$V-free.zip woo-coming-soon)
(cd .dist/pro  && zip -qr ../../woo-coming-soon-$V-pro.zip  woo-coming-soon)
rm -rf .dist && echo "Built $V (free + pro)"
