File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ # Install git hooks for version validation
2+ git config core.hooksPath Build/hooks
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+ TAGS=$( git tag --points-at HEAD | sed -nE ' s/^v?([0-9]+\.[0-9]+\.[0-9]+)$/\1/p' || true)
4+ [[ -z " ${TAGS} " ]] && exit 0
5+ PLUGIN_VERSION=$( python3 -c " import json; print(json.load(open('.claude-plugin/plugin.json'))['version'])" )
6+ if [[ -z " ${PLUGIN_VERSION} " ]]; then
7+ echo " ERROR: Could not extract version from .claude-plugin/plugin.json" >&2
8+ exit 1
9+ fi
10+ if ! echo " ${TAGS} " | grep -qFx " ${PLUGIN_VERSION} " ; then
11+ echo " ERROR: .claude-plugin/plugin.json version (${PLUGIN_VERSION} ) does not match any semver tag at HEAD." >&2
12+ echo " Tags found at HEAD:" >&2
13+ echo " ${TAGS} " >&2
14+ exit 1
15+ fi
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ " $( dirname " $0 " ) /../Scripts/check-plugin-version.sh"
You can’t perform that action at this time.
0 commit comments