wp-m365-login/bin/build-zip.sh
friloo 1517e7e3bc
Build ZIP with tar instead of rsync
rsync is not available everywhere; tar honours the same .distignore
patterns and ships with every CI runner.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJxAHYdMfKPoN4koRc4Ci2
2026-09-22 14:21:29 +00:00

25 lines
678 B
Bash
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Builds build/m365-login.zip the folder inside the archive is named after the
# WordPress.org slug (m365-login), regardless of the repository name.
# Only needs bash, tar and zip.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SLUG="m365-login"
BUILD="$ROOT/build"
STAGE="$BUILD/$SLUG"
rm -rf "$BUILD"
mkdir -p "$STAGE"
# Copy everything except the patterns listed in .distignore.
tar -C "$ROOT" --exclude-from="$ROOT/.distignore" --exclude='./build' -cf - . | tar -C "$STAGE" -xf -
(
cd "$BUILD"
rm -f "$SLUG.zip"
zip -rq "$SLUG.zip" "$SLUG"
)
echo "Created $BUILD/$SLUG.zip"
( cd "$STAGE" && find . -type f | sort )