2018-08-06 08:57:12 -07:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
require() {
|
|
|
|
declare expectedProgram="$1"
|
|
|
|
declare expectedVersion="$2"
|
|
|
|
|
|
|
|
read -r program version _ < <($expectedProgram -V)
|
|
|
|
|
|
|
|
declare ok=true
|
|
|
|
[[ $program = "$expectedProgram" ]] || ok=false
|
|
|
|
[[ $version =~ $expectedVersion ]] || ok=false
|
|
|
|
|
|
|
|
echo "Found $program $version"
|
|
|
|
if ! $ok; then
|
|
|
|
echo Error: expected "$expectedProgram $expectedVersion"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
case ${1:-stable} in
|
|
|
|
nightly)
|
2018-10-05 10:17:35 -07:00
|
|
|
require rustc 1.31.[0-9]+-nightly
|
2018-09-28 18:06:41 -07:00
|
|
|
require cargo 1.31.[0-9]+-nightly
|
2018-08-06 08:57:12 -07:00
|
|
|
;;
|
|
|
|
stable)
|
2018-10-25 16:48:34 -07:00
|
|
|
require rustc 1.30.[0-9]+
|
|
|
|
require cargo 1.30.[0-9]+
|
2018-08-06 08:57:12 -07:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo Error: unknown argument: "$1"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|