linkerd2-proxy/update-rust-version.sh

21 lines
477 B
Bash
Executable File

#!/bin/sh
set -eu
if [ $# -ne 1 ]; then
echo "usage: $0 VERSION" >&2
exit 64
fi
VERSION="$1"
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$' ; then
echo "Expected M.N.P; got '$VERSION'" >&2
exit 64
fi
echo "$VERSION" > rust-toolchain
find . -name Dockerfile\* \
-exec sed -i'' -Ee "s|rust:[0-9]+\.[0-9]+\.[0-9]+|rust:$VERSION|" '{}' \;
find .github -name \*.yml \
-exec sed -i'' -Ee "s|rust:[0-9]+\.[0-9]+\.[0-9]+|rust:$VERSION|" '{}' \;