diff options
| author | Drew Ritter <drew@primeradiant.com> | 2026-06-30 17:32:44 -0700 |
|---|---|---|
| committer | Jesse Vincent <jesse@fsck.com> | 2026-07-02 14:56:55 -0700 |
| commit | a50def9cefccb47d2e937fc237df980ee09e1fad (patch) | |
| tree | a633c30637e4183a1f1a07ed29e748e2d00a3042 | |
| parent | ec46cf8277fe15540ec74804011054bdcc078df5 (diff) | |
Strip hooks from Codex portal package
| -rwxr-xr-x | scripts/package-codex-plugin.sh | 4 | ||||
| -rwxr-xr-x | tests/codex/test-package-codex-plugin.sh | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/scripts/package-codex-plugin.sh b/scripts/package-codex-plugin.sh index 008644e..91458b5 100755 --- a/scripts/package-codex-plugin.sh +++ b/scripts/package-codex-plugin.sh @@ -243,7 +243,9 @@ 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 - die "Codex manifest must not declare hooks for the portal package" + 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 diff --git a/tests/codex/test-package-codex-plugin.sh b/tests/codex/test-package-codex-plugin.sh index d608674..3a3d715 100755 --- a/tests/codex/test-package-codex-plugin.sh +++ b/tests/codex/test-package-codex-plugin.sh @@ -140,6 +140,9 @@ extracted="$TEST_ROOT/extracted" tar_extracted="$TEST_ROOT/tar-extracted" write_metadata_fixture "$metadata_source" +source_hooks="$(python3 -c 'import json; print(json.load(open("'"$REPO_ROOT"'/.codex-plugin/plugin.json")).get("hooks"))')" +assert_equals "$source_hooks" "{}" "source Codex manifest suppresses local hook auto-discovery" + if output="$("$SCRIPT_UNDER_TEST" --allow-dirty --metadata-source "$metadata_source" --output "$archive" 2>&1)"; then pass "package script exits successfully" else |
