File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def _resolve_schema(
101101 hyperlink generation in documentation.
102102
103103 Returns:
104- Resolved schema as dict, or None if resolution fails.
104+ Resolved schema as dict, or raises RuntimeError if ucp-schema fails.
105105
106106 """
107107 bundle_suffix = ":bundled" if bundle else ""
@@ -121,20 +121,18 @@ def _resolve_schema(
121121 if bundle :
122122 cmd .append ("--bundle" )
123123
124- try :
125- result = subprocess .run (
126- cmd ,
127- capture_output = True ,
128- text = True ,
129- check = False ,
130- )
131- if result .returncode == 0 :
132- data = json .loads (result .stdout )
133- _resolved_schema_cache [cache_key ] = data
134- return data
135- except subprocess .SubprocessError :
136- pass
137- return None
124+ result = subprocess .run (
125+ cmd ,
126+ capture_output = True ,
127+ text = True ,
128+ check = False ,
129+ )
130+ if result .returncode == 0 :
131+ data = json .loads (result .stdout )
132+ _resolved_schema_cache [cache_key ] = data
133+ return data
134+ else :
135+ raise RuntimeError (f"ucp-schema execution error: result = { result } " )
138136
139137
140138# Backward compatibility alias
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4+ # When did we run this build?
5+ date
6+
47# Ensure we are running from the project root (parent of scripts/)
58cd " $( dirname " $0 " ) /.."
69PROJECT_ROOT=$( pwd)
@@ -15,6 +18,32 @@ GH_PAGES_BRANCH="gh-pages"
1518# Also add ucp-schema binary from sibling directory
1619export PATH=" $PROJECT_ROOT /.venv/bin:$PROJECT_ROOT /../ucp-schema/target/release:$PATH :$HOME /.cargo/bin"
1720
21+ # Check UCP-Schema CLI version vs current Crates.io version and prompt
22+ PURPLE=' \033[1;35m'
23+ NC=' \033[0m' # No Color
24+ echo " Using ucp-schema CLI: $( which ucp-schema) "
25+ UCP_CLI_VERSION=$( ucp-schema --version | sed ' s/ucp-schema //' )
26+ echo " Local ucp-schema version: '$UCP_CLI_VERSION '"
27+ UCP_CRATES_VERSION=$( cargo search ucp-schema -q | sed ' s/ucp-schema = "//' | sed ' s/".*$//' )
28+ echo " Crates ucp-schema version: '$UCP_CRATES_VERSION '"
29+ if [[ $UCP_CLI_VERSION != " $UCP_CRATES_VERSION " ]]; then
30+ while true ; do
31+ echo -e " ${PURPLE} *ucp-schema version mismatch*${NC} "
32+ read -r -p " Continue? (y/n) " yn
33+ case $yn in
34+ [Yy]* )
35+ echo " proceed..."
36+ break
37+ ;;
38+ [Nn]* )
39+ echo " exiting..."
40+ exit
41+ ;;
42+ * ) echo " invalid response" ;;
43+ esac
44+ done
45+ fi
46+
1847if ! command -v mike > /dev/null 2>&1 ; then
1948 echo " Error: mike executable not found in PATH."
2049 echo " Please ensure you have run 'uv sync' in the root."
You can’t perform that action at this time.
0 commit comments