MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / validate_self

Function validate_self

Tests/SdkIntegration/tactility.py:205–220  ·  view source on GitHub ↗
(sdk_json)

Source from the content-addressed store, hash-verified

203 exit_with_error("local build was requested, but TACTILITY_SDK_PATH environment variable is not set.")
204
205def validate_self(sdk_json):
206 if not "toolVersion" in sdk_json:
207 exit_with_error("Server returned invalid SDK data format (toolVersion not found)")
208 if not "toolCompatibility" in sdk_json:
209 exit_with_error("Server returned invalid SDK data format (toolCompatibility not found)")
210 if not "toolDownloadUrl" in sdk_json:
211 exit_with_error("Server returned invalid SDK data format (toolDownloadUrl not found)")
212 tool_version = sdk_json["toolVersion"]
213 tool_compatibility = sdk_json["toolCompatibility"]
214 if tool_version != ttbuild_version:
215 print_warning(f"New version available: {tool_version} (currently using {ttbuild_version})")
216 print_warning(f"Run 'tactility.py updateself' to update.")
217 if re.search(tool_compatibility, ttbuild_version) is None:
218 print_error("The tool is not compatible anymore.")
219 print_error("Run 'tactility.py updateself' to update.")
220 sys.exit(1)
221
222#endregion Validation
223

Callers 1

build_actionFunction · 0.85

Calls 3

exit_with_errorFunction · 0.70
print_warningFunction · 0.70
print_errorFunction · 0.70

Tested by

no test coverage detected