Skip to content

Commit 1895bc5

Browse files
feat: grab schema version from the crush package
1 parent 2abf97e commit 1895bc5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/generate-options.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33

44
set -euo pipefail
55

6-
# Get schema URL from argument or default
7-
SCHEMA_URL="${1:-https://charm.land/crush.json}"
6+
# Get the version from the crush package
7+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
VERSION=$(grep -oP 'version = "\K[^"]+' "$SCRIPT_DIR/../pkgs/crush/default.nix" | head -1)
9+
10+
# Build schema URL from version
11+
SCHEMA_URL="${1:-https://raw.githubusercontent.com/charmbracelet/crush/refs/tags/v${VERSION}/schema.json}"
812

913
# Call the Python script
10-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1114
TEMP_FILE=$(mktemp --suffix=.nix)
1215
trap 'rm -f "$TEMP_FILE"' EXIT
1316

0 commit comments

Comments
 (0)