Consolidate HG WordPress plugins
This commit is contained in:
commit
dccb8ed9bd
18 files changed
+1701
No files matched your search
Executable
+37
@@ -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())
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
exec python3 "$(dirname "${BASH_SOURCE[0]}")/build.py" "$@"
|
||||
Reference in new issue
Block a user