diff options
| author | Drew Ritter <drew@primeradiant.com> | 2026-06-30 17:45:41 -0700 |
|---|---|---|
| committer | Drew Ritter <drew@primeradiant.com> | 2026-06-30 17:45:41 -0700 |
| commit | 79d83245aaf4a730555d8f027ed0c1f8d1639e70 (patch) | |
| tree | 9e99d823bc5d1e6d332f260d207a113b8809f825 | |
| parent | f0fece940470ce3e53d46cebb1ce9243fc07ae15 (diff) | |
Preserve hooks in Codex package manifestcodex/pri-2443-codex-package-hooks
| -rwxr-xr-x | scripts/package-codex-plugin.sh | 6 | ||||
| -rwxr-xr-x | tests/codex/test-package-codex-plugin.sh | 2 |
2 files changed, 1 insertions, 7 deletions
diff --git a/scripts/package-codex-plugin.sh b/scripts/package-codex-plugin.sh index 91458b5..00399f0 100755 --- a/scripts/package-codex-plugin.sh +++ b/scripts/package-codex-plugin.sh @@ -242,12 +242,6 @@ git -C "$REPO_ROOT" archive --format=tar "$REF" -- \ VERSION="$(jq -r '.version // empty' "$STAGE/.codex-plugin/plugin.json")" [[ -n "$VERSION" ]] || die "could not read version from .codex-plugin/plugin.json" -if jq -e 'has("hooks")' "$STAGE/.codex-plugin/plugin.json" >/dev/null; then - manifest_tmp="$WORK_DIR/plugin-manifest.json" - jq 'del(.hooks)' "$STAGE/.codex-plugin/plugin.json" >"$manifest_tmp" - mv "$manifest_tmp" "$STAGE/.codex-plugin/plugin.json" -fi - if [[ -z "$OUTPUT" ]]; then case "$FORMAT" in zip) diff --git a/tests/codex/test-package-codex-plugin.sh b/tests/codex/test-package-codex-plugin.sh index 3a3d715..62c73f1 100755 --- a/tests/codex/test-package-codex-plugin.sh +++ b/tests/codex/test-package-codex-plugin.sh @@ -173,7 +173,7 @@ assert_contains "$archive_paths" "assets/superpowers-small.svg" "archive include manifest_summary="$(read_archive_file "$archive" .codex-plugin/plugin.json | python3 -c 'import json,sys; data=json.load(sys.stdin); print("\t".join([data["name"], data["version"], data["skills"], str(data.get("hooks"))]))')" expected_version="$(python3 -c 'import json; print(json.load(open("'"$REPO_ROOT"'/.codex-plugin/plugin.json"))["version"])')" -assert_equals "$manifest_summary" "superpowers $expected_version ./skills/ None" "archive manifest is current and hook-free" +assert_equals "$manifest_summary" "superpowers $expected_version ./skills/ $source_hooks" "archive manifest preserves source hooks" skill_count="$(find "$extracted/skills" -mindepth 1 -maxdepth 1 -type d | wc -l | tr -d ' ')" metadata_count="$(find "$extracted/skills" -path '*/agents/openai.yaml' -type f | wc -l | tr -d ' ')" |
