#!/usr/bin/env bash # Set the version everywhere it is recorded: VERSION (read by both CLIs and # stamped into health.json) and the bar widget's manifest. tests/static.sh # fails when the two disagree - they drifted apart once already (1.8.0 against # 1.9.3) with nothing to notice. # # scripts/bump-version.sh 1.13.0 set -euo pipefail cd "$(dirname "$0")/.." new="${1:-}" if ! [[ "$new" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "usage: scripts/bump-version.sh (now $(cat VERSION))" >&2 exit 1 fi printf '%s\n' "$new" > VERSION python3 - "$new" <<'PY' import json, re, sys path = "omarchy/smoido.claude-mode/manifest.json" text = open(path, encoding="utf-8").read() # A targeted substitution rather than a json.dump, so the file's own layout # (key order, spacing, the kinds array on one line) is left alone. new = re.sub(r'("version"\s*:\s*")[^"]*(")', lambda m: m.group(1) + sys.argv[1] + m.group(2), text, count=1) json.loads(new) open(path, "w", encoding="utf-8").write(new) PY echo "version $new - add a CHANGELOG.md entry for it"