enterprise/syn-serde/ci/install-rust.sh

21 lines
467 B
Bash
Raw Normal View History

2020-02-17 12:09:45 +00:00
#!/bin/bash
set -euo pipefail
toolchain="${1:-nightly}"
if rustup -V 2>/dev/null; then
rustup set profile minimal
rustup update "${toolchain}" --no-self-update
rustup default "${toolchain}"
else
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain "${toolchain}"
export PATH=${PATH}:${HOME}/.cargo/bin
echo "##[add-path]${HOME}/.cargo/bin"
fi
echo "Query rust and cargo versions:"
rustup -V
rustc -V
cargo -V