File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ trap 'find templates -name "*.bak" -delete' EXIT
1414usage () {
1515 echo " Usage: $0 <VERSION>"
1616 echo " Updates the Rust templates SDK dependency to the specified version"
17- echo " Example: $0 6 .0.0"
17+ echo " Example: $0 v6 .0.0"
1818}
1919
2020if [[ $# -ne 1 ]]
2424fi
2525
2626# Ensure version is an 'official' release
27- if [[ ! " ${VERSION} " =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]
27+ if [[ ! " ${VERSION} " =~ ^v [0-9]+.[0-9]+.[0-9]+$ ]]
2828then
29- echo " VERSION doesn't match [0-9]+.[0-9]+.[0-9]+ and may be a prerelease; skipping."
29+ echo " VERSION doesn't match v [0-9]+.[0-9]+.[0-9]+ and may be a prerelease; skipping."
3030 exit 1
3131fi
3232
33+ # Strip the leading v for Cargo.toml
34+ STRIPPED_VERSION=" ${VERSION# v} "
3335
3436# Update the version in the Cargo.toml.tmpl files for each Rust template
35- find templates -type f -path " templates/*-rust/content/Cargo.toml.tmpl" -exec $SED_INPLACE " /^\[dependencies\]/,/^\[/ s/^spin-sdk = \" .*\" /spin-sdk = \" ${VERSION } \" /" {} +
37+ find templates -type f -path " templates/*-rust/content/Cargo.toml.tmpl" -exec $SED_INPLACE " /^\[dependencies\]/,/^\[/ s/^spin-sdk = \" .*\" /spin-sdk = \" ${STRIPPED_VERSION } \" /" {} +
You can’t perform that action at this time.
0 commit comments