2021-01-19 12:56:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
PLUGIN_SLUG="woocommerce-beta-tester"
|
|
|
|
PROJECT_PATH=$(pwd)
|
|
|
|
BUILD_PATH="${PROJECT_PATH}/build"
|
|
|
|
DEST_PATH="$BUILD_PATH/$PLUGIN_SLUG"
|
|
|
|
|
|
|
|
echo "Generating build directory..."
|
|
|
|
rm -rf "$BUILD_PATH"
|
|
|
|
mkdir -p "$DEST_PATH"
|
|
|
|
|
|
|
|
echo "Installing PHP and JS dependencies..."
|
2022-04-20 23:17:59 +00:00
|
|
|
pnpm install
|
2021-01-19 12:56:37 +00:00
|
|
|
echo "Running JS Build..."
|
2023-11-17 18:11:56 +00:00
|
|
|
pnpm --filter='@woocommerce/plugin-woocommerce-beta-tester' build || exit "$?"
|
2021-01-19 12:56:37 +00:00
|
|
|
|
|
|
|
echo "Syncing files..."
|
|
|
|
rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded
|
|
|
|
|
|
|
|
echo "Generating zip file..."
|
|
|
|
cd "$BUILD_PATH" || exit
|
2024-06-28 09:54:05 +00:00
|
|
|
zip -q -r -9 "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/"
|
2021-01-19 12:56:37 +00:00
|
|
|
|
|
|
|
cd "$PROJECT_PATH" || exit
|
|
|
|
mv "$BUILD_PATH/${PLUGIN_SLUG}.zip" "$PROJECT_PATH"
|
|
|
|
echo "${PLUGIN_SLUG}.zip file generated!"
|
|
|
|
|
|
|
|
echo "Build done!"
|