Skip to content

Commit 1ff9d0a

Browse files
Apply suggestion from @gemini-code-assist[bot]
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 04492d2 commit 1ff9d0a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/generate_types.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ A2A_SPEC_VERSION="${A2A_SPEC_VERSION:-v0.3.0}"
1616
build_remote_url() {
1717
local version="$1"
1818
local base_url="https://raw.githubusercontent.com/a2aproject/A2A"
19+
local spec_path="specification/json/a2a.json"
20+
local url_part
1921

20-
if [[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
22+
if [[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
2123
# Looks like a version tag (v1.0.0, v1.2.3)
22-
echo "${base_url}/refs/tags/${version}/specification/json/a2a.json"
24+
url_part="refs/tags/${version}"
2325
elif [[ "$version" =~ ^[0-9a-f]{7,40}$ ]]; then
2426
# Looks like a commit SHA (7+ hex chars)
25-
echo "${base_url}/${version}/specification/json/a2a.json"
27+
url_part="${version}"
2628
else
2729
# Assume it's a branch name (main, develop, etc.)
28-
echo "${base_url}/refs/heads/${version}/specification/json/a2a.json"
30+
url_part="refs/heads/${version}"
2931
fi
32+
echo "${base_url}/${url_part}/${spec_path}"
3033
}
3134

3235
REMOTE_URL=$(build_remote_url "$A2A_SPEC_VERSION")

0 commit comments

Comments
 (0)