返回 DeepSeek-Reasonix
compare-cli-release-manifests.sh
根目录 / scripts / compare-cli-release-manifests.sh
1 #!/usr/bin/env bash
2 set -euo pipefail
3
4 candidate="${1:-}"
5 existing="${2:-}"
6
7 for manifest in "$candidate" "$existing"; do
8 if [ ! -f "$manifest" ]; then
9 echo "CLI release manifest does not exist: $manifest" >&2
10 exit 1
11 fi
12 done
13
14 # Immutable manifests published before release_notes_url existed remain valid.
15 # Normalize only that missing field from the strict candidate; every other
16 # semantic difference must still fail the immutable recovery check.
17 jq -e -s '
18 .[0] as $candidate |
19 .[1] as $existing |
20 ($existing | .release_notes_url = (.release_notes_url // $candidate.release_notes_url)) == $candidate
21 ' "$candidate" "$existing" >/dev/null
22
22 lines BASH