Consolidate HG WordPress plugins

This commit is contained in:
parkel committed 2026-11-18 01:22:22 +01:00
commit dccb8ed9bd
18 files changed
+1701

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env python3
"""Build the WordPress ZIP from explicitly listed release files."""
from pathlib import Path
import re
import sys
from zipfile import ZIP_DEFLATED, ZipFile
root = Path(__file__).resolve().parents[1]
destination = Path(sys.argv[1]) if len(sys.argv) > 1 else root / "dist"
version = re.search(r"^ \* Version: (\S+)$", (root / "hg-socialfeed.php").read_text(), re.MULTILINE)
if not version:
raise SystemExit("Missing plugin version")
files = (
"hg-socialfeed.php",
"README.md",
"readme.txt",
"LICENSE",
"includes/hg-admin-menu.php",
"includes/admin.php",
"includes/sources.php",
"includes/instagram.php",
"includes/facebook.php",
"includes/x.php",
"includes/shortcode.php",
"assets/hg-admin-menu.css",
"assets/feed.css",
"assets/feed.js",
)
destination.mkdir(parents=True, exist_ok=True)
release = destination / f"hg-socialfeed-{version[1]}.zip"
with ZipFile(release, "w", ZIP_DEFLATED) as archive:
for file in files:
archive.write(root / file, Path("hg_socialfeed") / file)
print(release.resolve())
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
exec python3 "$(dirname "${BASH_SOURCE[0]}")/build.py" "$@"