summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2019-10-15 14:06:01 +0200
committerLinus Färnstrand <linus@mullvad.net>2019-10-15 14:12:54 +0200
commit2d4d6dce788be5db233209e1adecd552a633aac2 (patch)
tree182c2f9acfa0dceb9f88262c0c7d16ce5f490aa2
parent87a954977bd354a4f6e365644b3bcb85cc3c6f74 (diff)
downloadmullvadvpn-2d4d6dce788be5db233209e1adecd552a633aac2.tar.xz
mullvadvpn-2d4d6dce788be5db233209e1adecd552a633aac2.zip
Only install Rust in ci script on *nix
-rwxr-xr-xci/ci-rust-script.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/ci/ci-rust-script.sh b/ci/ci-rust-script.sh
index 79e34731af..e4f03cc29d 100755
--- a/ci/ci-rust-script.sh
+++ b/ci/ci-rust-script.sh
@@ -12,9 +12,12 @@ if [ "${RUST_TOOLCHAIN_CHANNEL}" = "nightly" ]; then
RUST_EXTRA_COMPONENTS+=" -c rustfmt-preview"
fi
-curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
- sh -s -- -y --default-toolchain $RUST_TOOLCHAIN_CHANNEL --profile minimal $RUST_EXTRA_COMPONENTS
-source $HOME/.cargo/env
+# Install Rust if on Linux or macOS
+if [[ "$(uname -s)" == "Linux" || "$(uname -s)" == "Darwin" ]]; then
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
+ -y --default-toolchain $RUST_TOOLCHAIN_CHANNEL --profile minimal $RUST_EXTRA_COMPONENTS
+ source $HOME/.cargo/env
+fi
case "$(uname -s)" in
MINGW*|MSYS_NT*)
@@ -29,7 +32,7 @@ if [ "${RUST_TOOLCHAIN_CHANNEL}" != "nightly" ]; then
cargo test --locked --verbose
fi
-if [ "${RUST_TOOLCHAIN_CHANNEL}" = "nightly" ]; then
+if [[ "${RUST_TOOLCHAIN_CHANNEL}" == "nightly" && "$(uname -s)" == "Linux" ]]; then
rustfmt --version;
cargo fmt -- --check --unstable-features;
fi