Skip to content

Commit 2cd3515

Browse files
Update README.md
1 parent f67f481 commit 2cd3515

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,14 @@ curl -sL "https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads
8787
+ swift sdk install https://github.com/swiftwasm/swift/releases/download/swift-wasm-DEVELOPMENT-SNAPSHOT-2025-01-11-a/swift-wasm-DEVELOPMENT-SNAPSHOT-2025-01-11-a-wasm32-unknown-wasi.artifactbundle.zip --checksum c9b4f4c16015d196e565105a74bf39432f8ba8139c390052b221a5c12fcaf9be
8888
...
8989
```
90+
91+
### Get the id of the Swift SDK compatible with the currently selected toolchain
92+
93+
```console
94+
export SWIFT_SDK_ID=$(
95+
V="$(swiftc --version | head -n1)"; \
96+
TAG="$(curl -sL "https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/tag-by-version.json" | jq -e -r --arg v "$V" '.[$v] | .[-1]')"; \
97+
curl -sL "https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/builds/$TAG.json" | \
98+
jq -r '.["swift-sdks"]["wasm32-unknown-wasi"]["id"]'
99+
)
100+
```

0 commit comments

Comments
 (0)