diff --git a/bin/build-zip.sh b/bin/build-zip.sh index c8caf5a..05367fb 100755 --- a/bin/build-zip.sh +++ b/bin/build-zip.sh @@ -1,6 +1,7 @@ #!/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)" @@ -11,11 +12,8 @@ STAGE="$BUILD/$SLUG" rm -rf "$BUILD" mkdir -p "$STAGE" -# rsync honours .distignore-style excludes. -rsync -a --delete \ - --exclude-from="$ROOT/.distignore" \ - --exclude 'build' \ - "$ROOT/" "$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" @@ -24,4 +22,4 @@ rsync -a --delete \ ) echo "Created $BUILD/$SLUG.zip" -unzip -l "$BUILD/$SLUG.zip" | tail -n +4 | head -n -2 | awk '{print $4}' +( cd "$STAGE" && find . -type f | sort )